Whitespace + general cleanup

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot 2011-05-14 23:22:54 +02:00
parent 8217ff1836
commit 855f4133b6
216 changed files with 1649 additions and 1637 deletions

View file

@ -1,4 +1,3 @@
package org.bukkit;
import java.util.HashMap;
@ -31,9 +30,9 @@ public enum Achievement {
public final static int STATISTIC_OFFSET = 5242880;
private final static Map<Integer, Achievement> achievements = new HashMap<Integer, Achievement>();
private final int id;
private Achievement(int id) {
this.id = STATISTIC_OFFSET + id;
this.id = STATISTIC_OFFSET + id;
}
/**

View file

@ -4,13 +4,14 @@ package org.bukkit;
* A delegate for handling block changes. This serves as a direct interface
* between generation algorithms in the server implementation and utilizing
* code.
*
*
* @author sk89q
*/
public interface BlockChangeDelegate {
/**
* Set a block type at the specified coordinates.
*
*
* @param x
* @param y
* @param z
@ -21,7 +22,7 @@ public interface BlockChangeDelegate {
/**
* Set a block type and data at the specified coordinates.
*
*
* @param x
* @param y
* @param z
@ -30,7 +31,7 @@ public interface BlockChangeDelegate {
* @return true if the block was set successfully
*/
public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data);
/**
* Get the block type at the location.
* @param x

View file

@ -1,4 +1,3 @@
package org.bukkit;
/**
@ -10,8 +9,7 @@ public final class Bukkit {
/**
* Static class cannot be initialized.
*/
private Bukkit() {
}
private Bukkit() {}
/**
* Gets the current {@link Server} singleton

View file

@ -7,6 +7,7 @@ import java.util.Map;
* All supported color values for chat
*/
public enum ChatColor {
/**
* Represents black
*/
@ -110,9 +111,10 @@ public enum ChatColor {
* @return A copy of the input string, without any coloring
*/
public static String stripColor(final String input) {
if (input == null)
if (input == null) {
return null;
}
return input.replaceAll("(?i)\u00A7[0-F]", "");
}
@ -121,4 +123,4 @@ public enum ChatColor {
colors.put(color.getCode(), color);
}
}
}
}

View file

@ -1,4 +1,3 @@
package org.bukkit;
import org.bukkit.block.Block;
@ -40,8 +39,8 @@ public interface Chunk {
* @return the Block
*/
Block getBlock(int x, int y, int z);
Entity[] getEntities();
BlockState[] getTileEntities();
}

View file

@ -8,6 +8,7 @@ import java.util.Map;
* @author sunkid
*/
public enum CropState {
/**
* State when first seeded
*/

View file

@ -1,4 +1,3 @@
package org.bukkit;
import java.util.HashMap;
@ -8,6 +7,7 @@ import java.util.Map;
* All supported color values for dyes and cloth
*/
public enum DyeColor {
/**
* Represents white dye
*/

View file

@ -1,4 +1,3 @@
package org.bukkit;
import org.bukkit.block.Block;
@ -207,8 +206,9 @@ public class Location implements Cloneable {
vector.setY(-Math.sin(Math.toRadians(rotY)));
double h = Math.cos(Math.toRadians(rotY));
vector.setX(-h*Math.sin(Math.toRadians(rotX)));
vector.setZ(h*Math.cos(Math.toRadians(rotX)));
vector.setX(-h * Math.sin(Math.toRadians(rotX)));
vector.setZ(h * Math.cos(Math.toRadians(rotX)));
return vector;
}
@ -222,6 +222,7 @@ public class Location implements Cloneable {
return false;
}
final Location other = (Location) obj;
if (this.world != other.world && (this.world == null || !this.world.equals(other.world))) {
return false;
}
@ -246,6 +247,7 @@ public class Location implements Cloneable {
@Override
public int hashCode() {
int hash = 3;
hash = 19 * hash + (this.world != null ? this.world.hashCode() : 0);
hash = 19 * hash + (int) (Double.doubleToLongBits(this.x) ^ (Double.doubleToLongBits(this.x) >>> 32));
hash = 19 * hash + (int) (Double.doubleToLongBits(this.y) ^ (Double.doubleToLongBits(this.y) >>> 32));
@ -272,7 +274,8 @@ public class Location implements Cloneable {
@Override
public Location clone() {
try {
Location l = (Location)super.clone();
Location l = (Location) super.clone();
l.world = world;
l.x = x;
l.y = y;
@ -293,6 +296,6 @@ public class Location implements Cloneable {
* @return Block coordinate
*/
public static int locToBlock(double loc) {
return (int)Math.floor(loc);
return (int) Math.floor(loc);
}
}

View file

@ -237,7 +237,7 @@ public enum Material {
private Material(final int id, final int stack, final int durability, final Class<? extends MaterialData> data) {
this.id = id;
this.durability = (short)durability;
this.durability = (short) durability;
this.maxStack = stack;
this.data = data;
}
@ -292,6 +292,7 @@ public enum Material {
try {
Constructor<? extends MaterialData> ctor = data.getConstructor(int.class, byte.class);
return ctor.newInstance(id, raw);
} catch (InstantiationException ex) {
Logger.getLogger(Material.class.getName()).log(Level.SEVERE, null, ex);
@ -354,11 +355,11 @@ public enum Material {
try {
result = getMaterial(Integer.parseInt(name));
} catch (NumberFormatException ex) {
}
} catch (NumberFormatException ex) {}
if (result == null) {
String filtered = name.toUpperCase();
filtered = filtered.replaceAll("\\s+", "_").replaceAll("\\W", "");
result = lookupName.get(filtered);
}

View file

@ -1,4 +1,3 @@
package org.bukkit;
import com.avaje.ebean.config.ServerConfig;
@ -18,6 +17,7 @@ import org.bukkit.scheduler.BukkitScheduler;
* Represents a server implementation
*/
public interface Server {
/**
* Gets the name of this server implementation
*

View file

@ -1,4 +1,3 @@
package org.bukkit;
import java.util.HashMap;
@ -24,9 +23,9 @@ public enum Statistic {
private final boolean isBlock;
private Statistic(int id) {
this(id, false, false);
this(id, false, false);
}
private Statistic(int id, boolean isBlock) {
this(id, true, isBlock);
}

View file

@ -2,7 +2,7 @@ package org.bukkit;
/**
* Tree type.
*
*
* @author sk89q
*/
public enum TreeType {

View file

@ -1,4 +1,3 @@
package org.bukkit;
import java.util.List;
@ -11,6 +10,7 @@ import org.bukkit.util.Vector;
* Represents a world, which may contain entities, chunks and blocks
*/
public interface World {
/**
* Gets the {@link Block} at the given coordinates
*
@ -21,7 +21,7 @@ public interface World {
* @see #getBlockTypeIdAt(int, int, int) Returns the current type ID of the block
*/
public Block getBlockAt(int x, int y, int z);
/**
* Gets the {@link Block} at the given {@link Location}
*
@ -300,24 +300,24 @@ public interface World {
/**
* Creates a creature at the given {@link Location}
*
*
* @param loc The location to spawn the creature
* @param type The creature to spawn
* @return Resulting LivingEntity of this method, or null if it was unsuccessful
*/
public LivingEntity spawnCreature(Location loc, CreatureType type);
/**
* Strikes lightning at the given {@link Location}
*
*
* @param loc The location to strike lightning
* @return
*/
public LightningStrike strikeLightning(Location loc);
/**
* Strikes lightning at the given {@link Location} without doing damage
*
*
* @param loc The location to strike lightning
* @return
*/
@ -353,7 +353,7 @@ public interface World {
/**
* Gets a semi-unique identifier for this world.
*
*
* While it is highly unlikely that this may be shared with another World,
* it is not guaranteed to be unique
*
@ -370,7 +370,7 @@ public interface World {
/**
* Sets the spawn location of the world
*
*
* @return True if it was successfully set.
*/
public boolean setSpawnLocation(int x, int y, int z);
@ -417,61 +417,61 @@ public interface World {
* @see #setTime(long) Sets the relative time of this world
*/
public void setFullTime(long time);
/**
* Returns whether the world has an ongoing storm.
*
*
* @return Whether there is an ongoing storm
*/
public boolean hasStorm();
/**
* Set whether there is a storm. A duration will be set for the new
* current conditions.
*
*
* @param hasStorm Whether there is rain and snow
*/
public void setStorm(boolean hasStorm);
/**
* Get the remaining time in ticks of the current conditions.
*
*
* @return Time in ticks
*/
public int getWeatherDuration();
/**
* Set the remaining time in ticks of the current conditions.
*
*
* @param duration Time in ticks
*/
public void setWeatherDuration(int duration);
/**
* Returns whether there is thunder.
*
*
* @return Whether there is thunder
*/
public boolean isThundering();
/**
* Set whether it is thundering.
*
*
* @param thundering Whether it is thundering
*/
public void setThundering(boolean thundering);
/**
* Get the thundering duration.
*
*
* @return Duration in ticks
*/
public int getThunderDuration();
/**
* Set the thundering duration.
*
* @param duration Duration in ticks
*
* @param duration Duration in ticks
*/
public void setThunderDuration(int duration);
@ -486,11 +486,11 @@ public interface World {
* Represents various map environment types that a world may be
*/
public enum Environment {
/**
* Represents the "normal"/"surface world" map
*/
NORMAL,
/**
* Represents a nether based map
*/

View file

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

View file

@ -12,6 +12,7 @@ import org.bukkit.Location;
* block which will not be modified.
*/
public interface Block {
/**
* Gets the metadata for this block
*
@ -135,7 +136,7 @@ public interface Block {
* @param data New block specific metadata
*/
void setData(byte data);
void setData(byte data, boolean applyPhyiscs);
/**
@ -152,9 +153,9 @@ public interface Block {
* @return whether the block was changed
*/
boolean setTypeId(int type);
boolean setTypeId(int type, boolean applyPhysics);
boolean setTypeIdAndData(int type, byte data, boolean applyPhyiscs);
/**
@ -220,19 +221,19 @@ public interface Block {
* @return
*/
boolean isBlockFaceIndirectlyPowered(BlockFace face);
/**
* Returns the redstone power being provided to this block face
*
*
* @param face the face of the block to query or BlockFace.SELF for the block itself
* @return
* @return
*/
int getBlockPower(BlockFace face);
/**
* Returns the redstone power being provided to this block
*
* @return
*
* @return
*/
int getBlockPower();
}

View file

@ -55,33 +55,43 @@ public enum BlockFace {
public int getModZ() {
return modZ;
}
public BlockFace getOppositeFace() {
switch (this) {
case NORTH:
return BlockFace.SOUTH;
case SOUTH:
return BlockFace.NORTH;
case EAST:
return BlockFace.WEST;
case WEST:
return BlockFace.EAST;
case UP:
return BlockFace.DOWN;
case DOWN:
return BlockFace.UP;
case NORTH_EAST:
return BlockFace.SOUTH_WEST;
case NORTH_WEST:
return BlockFace.SOUTH_EAST;
case SOUTH_EAST:
return BlockFace.NORTH_WEST;
case SOUTH_WEST:
return BlockFace.NORTH_EAST;
case SELF:
return BlockFace.SELF;
}
return BlockFace.SELF;
}
}

View file

@ -1,4 +1,3 @@
package org.bukkit.block;
import org.bukkit.Chunk;
@ -15,6 +14,7 @@ import org.bukkit.material.MaterialData;
* another type entirely, causing your BlockState to become invalid.
*/
public interface BlockState {
/**
* Gets the block represented by this BlockState
*

View file

@ -2,8 +2,7 @@ package org.bukkit.block;
/**
* Represents a chest.
*
*
* @author sk89q
*/
public interface Chest extends BlockState, ContainerBlock {
}
public interface Chest extends BlockState, ContainerBlock {}

View file

@ -4,13 +4,14 @@ import org.bukkit.inventory.Inventory;
/**
* Indicates a block type that has inventory.
*
*
* @author sk89q
*/
public interface ContainerBlock {
/**
* Get the block's inventory.
*
*
* @return
*/
public Inventory getInventory();

View file

@ -2,52 +2,52 @@ package org.bukkit.block;
import org.bukkit.entity.CreatureType;
/**
* Represents a creature spawner.
*
*
* @author sk89q
* @author Cogito
*/
public interface CreatureSpawner extends BlockState {
/**
* Get the spawner's creature type.
*
*
* @return
*/
public CreatureType getCreatureType();
/**
* Set the spawner creature type.
*
*
* @param mobType
*/
public void setCreatureType(CreatureType creatureType);
/**
* Get the spawner's creature type.
*
*
* @return
*/
public String getCreatureTypeId();
/**
* Set the spawner mob type.
*
*
* @param creatureType
*/
public void setCreatureTypeId(String creatureType);
/**
* Get the spawner's delay.
*
*
* @return
*/
public int getDelay();
/**
* Set the spawner's delay.
*
*
* @param delay
*/
public void setDelay(int delay);

View file

@ -2,15 +2,16 @@ package org.bukkit.block;
/**
* Represents a dispenser.
*
*
* @author sk89q
*/
public interface Dispenser extends BlockState, ContainerBlock {
/**
* Attempts to dispense the contents of this block<br />
* <br />
* If the block is no longer a dispenser, this will return false
*
*
* @return true if successful, otherwise false
*/
public boolean dispense();

View file

@ -2,34 +2,35 @@ package org.bukkit.block;
/**
* Represents a furnace.
*
*
* @author sk89q
*/
public interface Furnace extends BlockState, ContainerBlock {
/**
* Get burn time.
*
*
* @return
*/
public short getBurnTime();
/**
* Set burn time.
*
*
* @param burnTime
*/
public void setBurnTime(short burnTime);
/**
* Get cook time.
*
*
* @return
*/
public short getCookTime();
/**
* Set cook time.
*
*
* @param cookTime
*/
public void setCookTime(short cookTime);

View file

@ -4,24 +4,25 @@ import org.bukkit.entity.Player;
/**
* Represents a note.
*
*
* @author sk89q
*/
public interface NoteBlock extends BlockState {
/**
* Gets the note.
*
*
* @return
*/
public byte getNote();
/**
* Set the note.
*
*
* @param note
*/
public void setNote(byte note);
/**
* Attempts to play the note at block<br />
* <br />
@ -30,7 +31,7 @@ public interface NoteBlock extends BlockState {
* @return true if successful, otherwise false
*/
public boolean play();
/**
* Plays an arbitrary note with an arbitrary instrument
*

View file

@ -1,10 +1,10 @@
package org.bukkit.block;
/**
* Represents either a SignPost or a WallSign
*/
public interface Sign extends BlockState {
/**
* Gets all the lines of text currently on this sign.
*

View file

@ -30,7 +30,7 @@ public abstract class Command {
/**
* Returns the name of this command
*
*
* @return Name of this command
*/
public String getName() {
@ -96,4 +96,4 @@ public abstract class Command {
this.usageMessage = usage;
return this;
}
}
}

View file

@ -1,4 +1,3 @@
package org.bukkit.command;
/**
@ -9,9 +8,7 @@ public class CommandException extends RuntimeException {
/**
* Creates a new instance of <code>CommandException</code> without detail message.
*/
public CommandException() {
}
public CommandException() {}
/**
* Constructs an instance of <code>CommandException</code> with the specified detail message.

View file

@ -1,10 +1,10 @@
package org.bukkit.command;
/**
* Represents a class which contains a single method for executing commands
*/
public interface CommandExecutor {
/**
* Executes the given command, returning its success
*

View file

@ -3,6 +3,7 @@ package org.bukkit.command;
import java.util.List;
public interface CommandMap {
/**
* Registers all the commands belonging to a certain plugin.
* @param plugin

View file

@ -2,8 +2,8 @@ package org.bukkit.command;
import org.bukkit.Server;
public interface CommandSender {
/**
* Sends this sender a message
*
@ -24,4 +24,4 @@ public interface CommandSender {
* @return Server instance
*/
public Server getServer();
}
}

View file

@ -1,4 +1,3 @@
package org.bukkit.command;
import org.bukkit.ChatColor;

View file

@ -39,10 +39,10 @@ public final class PluginCommand extends Command {
if (!success && usageMessage.length() > 0) {
for (String line: usageMessage.replace("<command>", commandLabel).split("\n")) {
sender.sendMessage( line );
sender.sendMessage(line);
}
}
return success;
}
@ -72,4 +72,4 @@ public final class PluginCommand extends Command {
public Plugin getPlugin() {
return owningPlugin;
}
}
}

View file

@ -13,20 +13,23 @@ public class PluginCommandYamlParser {
public static List<Command> parse(Plugin plugin) {
List<Command> pluginCmds = new ArrayList<Command>();
Object object = plugin.getDescription().getCommands();
if (object == null)
return pluginCmds;
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>)object;
if (object == null) {
return pluginCmds;
}
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) object;
if (map != null) {
for(Entry<String, Map<String, Object>> entry : map.entrySet()) {
Command newCmd = new PluginCommand(entry.getKey(),plugin);
for (Entry<String, Map<String, Object>> entry : map.entrySet()) {
Command newCmd = new PluginCommand(entry.getKey(), plugin);
Object description = entry.getValue().get("description");
Object usage = entry.getValue().get("usage");
Object aliases = entry.getValue().get("aliases");
if (description != null)
if (description != null) {
newCmd.setDescription(description.toString());
}
if (usage != null) {
newCmd.setUsage(usage.toString());
@ -34,9 +37,9 @@ public class PluginCommandYamlParser {
if (aliases != null) {
List<String> aliasList = new ArrayList<String>();
if (aliases instanceof List) {
for (Object o : (List<Object>)aliases) {
for (Object o : (List<Object>) aliases) {
aliasList.add(o.toString());
}
} else {
@ -51,5 +54,4 @@ public class PluginCommandYamlParser {
}
return pluginCmds;
}
}

View file

@ -34,7 +34,7 @@ public final class SimpleCommandMap implements CommandMap {
*/
public void registerAll(String fallbackPrefix, List<Command> commands) {
if (commands != null) {
for(Command c : commands) {
for (Command c : commands) {
register(fallbackPrefix, c);
}
}
@ -42,6 +42,7 @@ public final class SimpleCommandMap implements CommandMap {
private void register(String fallbackPrefix, Command command) {
List<String> names = new ArrayList<String>();
names.add(command.getName());
names.addAll(command.getAliases());
@ -55,7 +56,7 @@ public final class SimpleCommandMap implements CommandMap {
*/
public boolean register(String name, String fallbackPrefix, Command command) {
boolean nameInUse = (getCommand(name) != null);
if (nameInUse) {
name = fallbackPrefix + ":" + name;
}
@ -63,7 +64,7 @@ public final class SimpleCommandMap implements CommandMap {
knownCommands.put(name.toLowerCase(), command);
return !nameInUse;
}
/**
* {@inheritDoc}
*/
@ -80,6 +81,7 @@ public final class SimpleCommandMap implements CommandMap {
Command target = getCommand(sentCommandLabel);
boolean isRegisteredCommand = (target != null);
if (isRegisteredCommand) {
try {
target.execute(sender, sentCommandLabel, args);
@ -117,8 +119,7 @@ public final class SimpleCommandMap implements CommandMap {
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (args.length == 0) {
sender.sendMessage("This server is running " + ChatColor.GREEN
+ server.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + server.getVersion());
sender.sendMessage("This server is running " + ChatColor.GREEN + server.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + server.getVersion());
sender.sendMessage("This server is also sporting some funky dev build of Bukkit!");
} else {
StringBuilder name = new StringBuilder();
@ -134,6 +135,7 @@ public final class SimpleCommandMap implements CommandMap {
if (plugin != null) {
PluginDescriptionFile desc = plugin.getDescription();
sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion());
if (desc.getDescription() != null) {
@ -242,4 +244,4 @@ public final class SimpleCommandMap implements CommandMap {
return pluginList.toString();
}
}
}
}

View file

@ -1,5 +1,3 @@
package org.bukkit.entity;
public interface AnimalTamer {
}
public interface AnimalTamer {}

View file

@ -2,10 +2,8 @@ package org.bukkit.entity;
/**
* Represents an Animal.
*
*
* @author Cogito
*
*/
public interface Animals extends Creature{
}
public interface Animals extends Creature {}

View file

@ -2,8 +2,7 @@ package org.bukkit.entity;
/**
* Represents an arrow.
*
*
* @author sk89q
*/
public interface Arrow extends Entity {
}
public interface Arrow extends Entity {}

View file

@ -2,10 +2,11 @@ package org.bukkit.entity;
/**
* Represents a boat entity.
*
*
* @author sk89q
*/
public interface Boat extends Vehicle {
/**
* Gets the maximum speed of a boat. The speed is unrelated to the velocity.
*

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Chicken.
*
*
* @author Cogito
*
*/
public interface Chicken extends Animals {
}
public interface Chicken extends Animals {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Cow.
*
*
* @author Cogito
*
*/
public interface Cow extends Animals {
}
public interface Cow extends Animals {}

View file

@ -5,6 +5,7 @@ package org.bukkit.entity;
* have very simple abilities.
*/
public interface Creature extends LivingEntity {
/**
* Instructs this Creature to set the specified LivingEntity as its target.
* Hostile creatures may attack their target, and friendly creatures may

View file

@ -1,10 +1,10 @@
package org.bukkit.entity;
/**
* Represents a Creeper
*/
public interface Creeper extends Monster {
/**
* Checks if this Creeper is powered (Electrocuted)
*

View file

@ -2,8 +2,7 @@ package org.bukkit.entity;
/**
* Represents an egg.
*
*
* @author sk89q
*/
public interface Egg extends Entity {
}
public interface Egg extends Entity {}

View file

@ -1,4 +1,3 @@
package org.bukkit.entity;
import org.bukkit.Location;
@ -12,6 +11,7 @@ import java.util.List;
* Represents a base entity in the world
*/
public interface Entity {
/**
* Gets the entity's current position
*
@ -109,7 +109,7 @@ public interface Entity {
* @param ticks
*/
public void setFireTicks(int ticks);
/**
* Mark the entity's removal.
*/
@ -130,14 +130,14 @@ public interface Entity {
/**
* Gets the primary passenger of a vehicle. For vehicles that could have
* multiple passengers, this will only return the primary passenger.
*
*
* @return an entity
*/
public abstract Entity getPassenger();
/**
* Set the passenger of a vehicle.
*
*
* @param passenger
* @return false if it could not be done for whatever reason
*/
@ -145,27 +145,27 @@ public interface Entity {
/**
* Returns true if the vehicle has no passengers.
*
*
* @return
*/
public abstract boolean isEmpty();
/**
* Eject any passenger. True if there was a passenger.
*
*
* @return
*/
public abstract boolean eject();
/**
* Returns the distance this entity has fallen
* @return
* @return
*/
public float getFallDistance();
/**
* Sets the fall distance for this entity
* @param distance
* @param distance
*/
public void setFallDistance(float distance);

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents Falling Sand.
*
*
* @author Cogito
*
*/
public interface FallingSand extends Entity {
}
public interface FallingSand extends Entity {}

View file

@ -2,8 +2,7 @@ package org.bukkit.entity;
/**
* Represents a Fireball.
*
*
* @author Cogito
*/
public interface Fireball extends Entity {
}
public interface Fireball extends Entity {}

View file

@ -2,8 +2,7 @@ package org.bukkit.entity;
/**
* Represents a Fish.
*
*
* @author Cogito
*/
public interface Fish extends Entity {
}
public interface Fish extends Entity {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Flying Entity.
*
*
* @author Cogito
*
*/
public interface Flying extends LivingEntity {
}
public interface Flying extends LivingEntity {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Ghast.
*
*
* @author Cogito
*
*/
public interface Ghast extends Flying {
}
public interface Ghast extends Flying {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Giant.
*
*
* @author Cogito
*
*/
public interface Giant extends Monster {
}
public interface Giant extends Monster {}

View file

@ -1,4 +1,3 @@
package org.bukkit.entity;
import org.bukkit.inventory.ItemStack;
@ -8,6 +7,7 @@ import org.bukkit.inventory.PlayerInventory;
* Represents a human entity, such as an NPC or a player
*/
public interface HumanEntity extends LivingEntity, AnimalTamer {
/**
* Returns the name of this player
*
@ -43,19 +43,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer {
*
* @param index The new index to use, only valid ones are 0-8.
*
public void selectItemInHand( int index );
*/
public void selectItemInHand(int index);
*/
/**
* Returns whether this player is slumbering.
*
*
* @return slumber state
*/
public boolean isSleeping();
/**
* Get the sleep ticks of the player. This value may be capped.
*
*
* @return slumber ticks
*/
public int getSleepTicks();

View file

@ -4,7 +4,7 @@ import org.bukkit.inventory.ItemStack;
/**
* Represents an Item.
*
*
* @author Cogito
*
*/
@ -12,15 +12,15 @@ public interface Item extends Entity {
/**
* Gets the item stack associated with this item drop.
*
*
* @return
*/
public ItemStack getItemStack();
/**
* Sets the item stack associated with this item drop.
*
* @param stack
*
* @param stack
*/
public void setItemStack(ItemStack stack);
}

View file

@ -1,18 +1,17 @@
package org.bukkit.entity;
/**
* Represents an instance of a lightning strike. May or may not do damage.
*
*
* @author sk89q
*/
public interface LightningStrike extends Weather {
/**
* Returns whether the strike is an effect that does no damage.
*
*
* @return whether the strike is an effect
*/
public boolean isEffect();
}

View file

@ -1,4 +1,3 @@
package org.bukkit.entity;
import java.util.HashSet;
@ -11,6 +10,7 @@ import org.bukkit.block.Block;
* Represents a living entity, such as a monster or player
*/
public interface LivingEntity extends Entity {
/**
* Gets the entity's health from 0-20, where 0 is dead and 20 is full
*
@ -57,7 +57,7 @@ public interface LivingEntity extends Entity {
*/
public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance);
/**
/**
* Gets the block that the player has targeted
*
* @param HashSet<Byte> HashSet containing all transparent block IDs. If set to null only air is considered transparent.
@ -66,7 +66,7 @@ public interface LivingEntity extends Entity {
*/
public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance);
/**
/**
* Gets the last two blocks along the player's line of sight.
* The target block will be the last block in the list.
*
@ -164,14 +164,14 @@ public interface LivingEntity extends Entity {
* Returns the entities current maximum noDamageTicks
* This is the time in ticks the entity will become unable to take
* equal or less damage than the lastDamage
*
*
* @return noDamageTicks
*/
public int getMaximumNoDamageTicks();
/**
* Sets the entities current maximum noDamageTicks
*
*
* @param ticks maximumNoDamageTicks
*/
public void setMaximumNoDamageTicks(int ticks);
@ -179,31 +179,30 @@ public interface LivingEntity extends Entity {
/**
* Returns the entities lastDamage taken in the current noDamageTicks time.
* Only damage higher than this amount will further damage the entity.
*
*
* @return lastDamage
*/
public int getLastDamage();
/**
* Sets the entities current maximum noDamageTicks
*
*
* @param damage last damage
*/
public void setLastDamage(int damage);
/**
* Returns the entities current noDamageTicks
*
*
* @return noDamageTicks
*/
public int getNoDamageTicks();
/**
* Sets the entities current noDamageTicks
*
*
* @param ticks NoDamageTicks
*/
public void setNoDamageTicks(int ticks);
}

View file

@ -4,20 +4,21 @@ import org.bukkit.util.Vector;
/**
* Represents a minecart entity.
*
*
* @author sk89q
*/
public interface Minecart extends Vehicle {
/**
* Sets a minecart's damage.
*
*
* @param damage over 40 to "kill" a minecart
*/
public void setDamage(int damage);
/**
* Gets a minecart's damage.
*
*
* @param damage
*/
public int getDamage();

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Monster.
*
*
* @author Cogito
*
*/
public interface Monster extends Creature {
}
public interface Monster extends Creature {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Painting.
*
*
* @author Cogito
*
*/
public interface Painting extends Entity {
}
public interface Painting extends Entity {}

View file

@ -2,17 +2,18 @@ package org.bukkit.entity;
/**
* Represents a Pig.
*
*
* @author Cogito
*
*/
public interface Pig extends Animals {
/**
* @author xPaw
* @return if the pig has been saddled.
*/
public boolean hasSaddle();
/**
* @author xPaw
* @param saddled set if the pig has a saddle or not.

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Pig Zombie.
*
*
* @author Cogito
*
*/
public interface PigZombie extends Zombie {
}
public interface PigZombie extends Zombie {}

View file

@ -1,4 +1,3 @@
package org.bukkit.entity;
import java.net.InetSocketAddress;
@ -13,6 +12,7 @@ import org.bukkit.command.CommandSender;
*
*/
public interface Player extends HumanEntity, CommandSender {
/**
* Checks if this player is currently online
*
@ -59,7 +59,7 @@ public interface Player extends HumanEntity, CommandSender {
* @return the player's address
*/
public InetSocketAddress getAddress();
/**
* Sends this sender a message raw
*
@ -112,53 +112,53 @@ public interface Player extends HumanEntity, CommandSender {
* Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file.
*/
public void loadData();
/**
* Sets whether the player is ignored as not sleeping. If everyone is
* either sleeping or has this flag set, then time will advance to the
* next day. If everyone has this flag set but no one is actually in bed,
* then nothing will happen.
*
*
* @param isSleeping
*/
public void setSleepingIgnored(boolean isSleeping);
/**
* Returns whether the player is sleeping ignored.
*
*
* @return
*/
public boolean isSleepingIgnored();
/**
* Play a note for a player at a location. This requires a note block
* at the particular location (as far as the client is concerned). This
* will not work without a note block. This will not work with cake.
*
*
* @param loc
* @param instrument
* @param note
* @return
*/
public void playNote(Location loc, byte instrument, byte note);
/**
* Send a block change. This fakes a block change packet for a user at
* a certain location. This will not actually change the world in any way.
*
*
* @param loc
* @param material
* @param data
* @param data
*/
public void sendBlockChange(Location loc, Material material, byte data);
/**
* Send a block change. This fakes a block change packet for a user at
* a certain location. This will not actually change the world in any way.
*
*
* @param loc
* @param material
* @param data
* @param data
*/
public void sendBlockChange(Location loc, int material, byte data);

View file

@ -2,9 +2,7 @@ package org.bukkit.entity;
/**
* Represents a powered minecart.
*
*
* @author sk89q
*/
public interface PoweredMinecart extends Minecart {
}
public interface PoweredMinecart extends Minecart {}

View file

@ -1,21 +1,24 @@
/**
*
*
*/
package org.bukkit.entity;
import org.bukkit.material.Colorable;
/**
* Represents a Sheep.
*
*
* @author Cogito
*
*/
public interface Sheep extends Animals, Colorable {
/**
* @author Celtic Minstrel
* @return Whether the sheep is sheared.
*/
public boolean isSheared();
/**
* @author Celtic Minstrel
* @param flag Whether to shear the sheep

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Skeleton.
*
*
* @author Cogito
*
*/
public interface Skeleton extends Monster {
}
public interface Skeleton extends Monster {}

View file

@ -1,20 +1,22 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Slime.
*
*
* @author Cogito
*
*/
public interface Slime extends LivingEntity {
/**
* @author Celtic Minstrel
* @return The size of the slime
*/
public int getSize();
/**
* @author Celtic Minstrel
* @param sz The new size of the slime.

View file

@ -2,8 +2,7 @@ package org.bukkit.entity;
/**
* Implements a snowball.
*
*
* @author sk89q
*/
public interface Snowball extends Entity {
}
public interface Snowball extends Entity {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Spider.
*
*
* @author Cogito
*
*/
public interface Spider extends Monster {
}
public interface Spider extends Monster {}

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Squid.
*
*
* @author Cogito
*
*/
public interface Squid extends WaterMob {
}
public interface Squid extends WaterMob {}

View file

@ -4,13 +4,14 @@ import org.bukkit.inventory.Inventory;
/**
* Represents a storage minecart.
*
*
* @author sk89q
*/
public interface StorageMinecart extends Minecart {
/**
* Return the inventory object for this StorageMinecart.
*
*
* @return The inventory for this Minecart
*/
public Inventory getInventory();

View file

@ -1,14 +1,12 @@
/**
*
*
*/
package org.bukkit.entity;
/**
* Represents a Primed TNT.
*
*
* @author Cogito
*
*/
public interface TNTPrimed extends Entity {
}
public interface TNTPrimed extends Entity {}

View file

@ -4,20 +4,21 @@ import org.bukkit.util.Vector;
/**
* Represents a vehicle entity.
*
*
* @author sk89q
*/
public interface Vehicle extends Entity {
/**
* Gets the vehicle's velocity.
*
*
* @return velocity vector
*/
public Vector getVelocity();
/**
* Sets the vehicle's velocity.
*
*
* @param vel velocity vector
*/
public void setVelocity(Vector vel);

View file

@ -1,5 +1,5 @@
/**
*
*
*/
package org.bukkit.entity;
@ -8,6 +8,4 @@ package org.bukkit.entity;
* @author Cogito
*
*/
public interface WaterMob extends Creature {
}
public interface WaterMob extends Creature {}

View file

@ -1,9 +1,6 @@
package org.bukkit.entity;
/**
* Represents a Weather related entity, such as a storm
*/
public interface Weather extends Entity {
}
public interface Weather extends Entity {}

View file

@ -1,10 +1,10 @@
package org.bukkit.entity;
/**
* Represents a Wolf
*/
public interface Wolf extends Animals, Tameable {
/**
* Checks if this wolf is angry
*

View file

@ -2,10 +2,8 @@ package org.bukkit.entity;
/**
* Represents a Zombie.
*
*
* @author Cogito
*
*/
public interface Zombie extends Monster{
}
public interface Zombie extends Monster {}

View file

@ -6,14 +6,12 @@ import org.bukkit.event.Listener;
* Handles all custom events
*/
public class CustomEventListener implements Listener {
public CustomEventListener() {
}
public CustomEventListener() {}
/**
* Called when a player joins a server
*
* @param event Relevant event details
*/
public void onCustomEvent(Event event) {
}
}
public void onCustomEvent(Event event) {}
}

View file

@ -31,7 +31,9 @@ public abstract class Event implements Serializable {
}
private void exAssert(boolean b, String s) {
if(!b) throw new IllegalArgumentException(s);
if (!b) {
throw new IllegalArgumentException(s);
}
}
/**
@ -40,40 +42,36 @@ public abstract class Event implements Serializable {
* @return Name of this event
*/
public final String getEventName() {
return ( type != Type.CUSTOM_EVENT) ? type.toString() : name;
return (type != Type.CUSTOM_EVENT) ? type.toString() : name;
}
/**
* Represents an events priority in execution
*/
public enum Priority {
/**
* Event call is of very low importance and should be ran first, to allow
* other plugins to further customise the outcome
*/
Lowest,
/**
* Event call is of low importance
*/
Low,
/**
* Event call is neither important or unimportant, and may be ran normally
*/
Normal,
/**
* Event call is of high importance
*/
High,
/**
* Event call is critical and must have the final say in what happens
* to the event
*/
Highest,
/**
* Event is listened to purely for monitoring the outcome of an event.
*
@ -86,52 +84,44 @@ public abstract class Event implements Serializable {
* Represents a category used by Type
*/
public enum Category {
/**
* Represents Player-based events
* @see Category.LIVING_ENTITY
*/
PLAYER,
/**
* Represents Entity-based events
*/
ENTITY,
/**
* Represents Block-based events
*/
BLOCK,
/**
* Represents LivingEntity-based events
*/
LIVING_ENTITY,
/**
* Represents Weather-based events
*/
WEATHER,
/**
* Vehicle-based events
*/
VEHICLE,
/**
* Represents World-based events
*/
WORLD,
/**
* Represents Server and Plugin based events
*/
SERVER,
/**
* Represents Inventory-based events
*/
INVENTORY,
/**
* Any miscellaneous events
*/
@ -144,6 +134,7 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.
*/
public enum Type {
/**
* PLAYER EVENTS
*/
@ -154,154 +145,132 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.player.PlayerEvent
*/
PLAYER_JOIN (Category.PLAYER),
/**
* Called when a player is attempting to connect to the server
*
* @see org.bukkit.event.player.PlayerLoginEvent
*/
PLAYER_LOGIN (Category.PLAYER),
/**
* Called when a player has just been authenticated
*
* @see org.bukkit.event.player.PlayerPreLoginEvent
*/
PLAYER_PRELOGIN (Category.PLAYER),
/**
* Called when a player respawns
*
* @see org.bukkit.event.player.PlayerEvent
*/
PLAYER_RESPAWN (Category.PLAYER),
/**
* Called when a player gets kicked a server
*
* @see org.bukkit.event.player.PlayerEvent
*/
PLAYER_KICK (Category.PLAYER),
/**
* Called when a player sends a chat message
*
* @see org.bukkit.event.player.PlayerChatEvent
*/
PLAYER_CHAT (Category.PLAYER),
/**
* Called when a player early in the command handling process
*
* @see org.bukkit.event.player.PlayerChatEvent
*/
PLAYER_COMMAND_PREPROCESS (Category.PLAYER),
/**
* Called when a player leaves a server
*
* @see org.bukkit.event.player.PlayerEvent
*/
PLAYER_QUIT (Category.PLAYER),
/**
* Called when a player moves position in the world
*
* @see org.bukkit.event.player.PlayerMoveEvent
*/
PLAYER_MOVE (Category.PLAYER),
/**
* Called when a player undergoes an animation, such as arm swinging
*
* @see org.bukkit.event.player.PlayerAnimationEvent
*/
PLAYER_ANIMATION (Category.PLAYER),
/**
* Called when a player toggles sneak mode
*
* @todo: add javadoc see comment
*/
PLAYER_TOGGLE_SNEAK (Category.PLAYER),
/**
* Called when a player uses an item
*
* @see org.bukkit.event.player.PlayerItemEvent
*/
PLAYER_INTERACT (Category.PLAYER),
/**
* Called when a player right clicks an entity
*
* @see org.bukkit.event.player.PlayerInteractEntityEvent
*/
PLAYER_INTERACT_ENTITY (Category.PLAYER),
/**
* Called when a player throws an egg and it might hatch
*
* @see org.bukkit.event.player.PlayerEggThrowEvent
*/
PLAYER_EGG_THROW (Category.PLAYER),
/**
* Called when a player teleports from one position to another
*
* @see org.bukkit.event.player.PlayerMoveEvent
*/
PLAYER_TELEPORT (Category.PLAYER),
/**
* Called when a player changes their held item
*
* @see org.bukkit.event.player.PlayerItemHeldEvent
*/
PLAYER_ITEM_HELD (Category.PLAYER),
/**
* Called when a player drops an item
*
* @see org.bukkit.event.player.PlayerDropItemEvent
*/
PLAYER_DROP_ITEM (Category.PLAYER),
/**
* Called when a player picks an item up off the ground
*
* @see org.bukkit.event.player.PlayerPickupItemEvent
*/
PLAYER_PICKUP_ITEM (Category.PLAYER),
/**
* Called when a player empties a bucket
*
* @see org.bukkit.event.player.PlayerBucketEmptyEvent
*/
PLAYER_BUCKET_EMPTY(Category.PLAYER),
/**
* Called when a player fills a bucket
*
* @see org.bukkit.event.player.PlayerBucketFillEvent
*/
PLAYER_BUCKET_FILL(Category.PLAYER),
/**
* Called when a player interacts with the inventory
*
* @see org.bukkit.event.player.PlayerInventoryEvent
*/
PLAYER_INVENTORY(Category.PLAYER),
/**
* Called when a player enter a bed
*
* @see org.bukkit.event.player.PlayerBedEnterEvent
*/
PLAYER_BED_ENTER(Category.PLAYER),
/**
* Called when a player leaves a bed
*
@ -319,7 +288,6 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.block.BlockDamageEvent
*/
BLOCK_DAMAGE (Category.BLOCK),
/**
* Called when a block is undergoing a universe physics
* check on whether it can be built
@ -329,7 +297,6 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.block.BlockCanBuildEvent
*/
BLOCK_CANBUILD (Category.BLOCK),
/**
* Called when a block of water or lava attempts to flow into another
* block
@ -337,7 +304,6 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.block.BlockFromToEvent
*/
BLOCK_FROMTO (Category.BLOCK),
/**
* Called when a block is being set on fire from another block, such as
* an adjacent block of fire attempting to set fire to wood
@ -345,7 +311,6 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.block.BlockIgniteEvent
*/
BLOCK_IGNITE (Category.BLOCK),
/**
* Called when a block undergoes a physics check
*
@ -355,42 +320,36 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.block.BlockPhysicsEvent
*/
BLOCK_PHYSICS (Category.BLOCK),
/**
* Called when a player is attempting to place a block
*
* @see org.bukkit.event.block.BlockPlaceEvent
*/
BLOCK_PLACE (Category.BLOCK),
/**
* Called when a block dispenses something
*
* @see org.bukkit.event.block.BlockPlaceEvent
*/
BLOCK_DISPENSE (Category.BLOCK),
/**
* Called when a block is destroyed from being burnt by fire
*
* @see org.bukkit.event.block.BlockBurnEvent
*/
BLOCK_BURN (Category.BLOCK),
/**
* Called when leaves are decaying naturally
*
* @see org.bukkit.event.block.LeavesDecayEvent
*/
LEAVES_DECAY (Category.BLOCK),
/**
* Called when a sign is changed
*
* @see org.bukkit.event.block.SignChangeEvent
*/
SIGN_CHANGE (Category.BLOCK),
/**
* Called when a block changes redstone current. Only triggered on blocks
* that are actually capable of transmitting or carrying a redstone
@ -399,14 +358,12 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.block.BlockFromToEvent
*/
REDSTONE_CHANGE (Category.BLOCK),
/**
* Called when a block is destroyed by a player.
*
* @see org.bukkit.event.block.BlockBreakEvent
*/
BLOCK_BREAK (Category.BLOCK),
/**
* Called when world attempts to place a snow block during a snowfall
*
@ -424,28 +381,24 @@ public abstract class Event implements Serializable {
* @todo: add javadoc see comment
*/
INVENTORY_OPEN (Category.INVENTORY),
/**
* Called when a player closes an inventory
*
* @todo: add javadoc see comment
*/
INVENTORY_CLOSE (Category.INVENTORY),
/**
* Called when a player clicks on an inventory slot
*
* @todo: add javadoc see comment
*/
INVENTORY_CLICK (Category.INVENTORY),
/**
* Called when an inventory slot changes values or type
*
* @todo: add javadoc see comment
*/
INVENTORY_CHANGE (Category.INVENTORY),
/**
* Called when a player is attempting to perform an inventory transaction
*
@ -463,14 +416,12 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.server.PluginEvent
*/
PLUGIN_ENABLE (Category.SERVER),
/**
* Called when a plugin is disabled
*
* @see org.bukkit.event.server.PluginEvent
*/
PLUGIN_DISABLE (Category.SERVER),
/**
* Called when a server command is called
*
@ -491,41 +442,35 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.world.ChunkLoadEvent
*/
CHUNK_LOAD (Category.WORLD),
/**
* Called when a chunk is unloaded
*
* @see org.bukkit.event.world.ChunkUnloadEvent
*/
CHUNK_UNLOAD (Category.WORLD),
/**
* Called when a chunk needs to be generated
*
* @todo: add javadoc see comment
*/
CHUNK_GENERATION (Category.WORLD),
/**
* Called when an ItemEntity spawns in the world
*
* @todo: add javadoc see comment
*/
ITEM_SPAWN (Category.WORLD),
/**
* Called when a World's spawn is changed
*
* @see org.bukkit.event.world.SpawnChangeEvent
*/
SPAWN_CHANGE (Category.WORLD),
/**
* Called when a world is saved
*
*/
WORLD_SAVE (Category.WORLD),
/**
* Called when a World is loaded
*/
@ -541,7 +486,6 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.painting.PaintingCreateEvent
*/
PAINTING_PLACE (Category.ENTITY),
/**
* Called when a painting is removed
*
@ -560,35 +504,30 @@ public abstract class Event implements Serializable {
* @todo: add javadoc see comment
*/
CREATURE_SPAWN (Category.LIVING_ENTITY),
/**
* Called when a LivingEntity is damaged with no source.
*
* @see org.bukkit.event.entity.EntityDamageEvent
*/
ENTITY_DAMAGE (Category.LIVING_ENTITY),
/**
* Called when a LivingEntity dies
*
* @todo: add javadoc see comment
*/
ENTITY_DEATH (Category.LIVING_ENTITY),
/**
* Called when a Skeleton or Zombie catch fire due to the sun
*
* @todo: add javadoc see comment
*/
ENTITY_COMBUST (Category.LIVING_ENTITY),
/**
* Called when an entity explodes, either TNT, Creeper, or Ghast Fireball
*
* @todo: add javadoc see comment
*/
ENTITY_EXPLODE (Category.LIVING_ENTITY),
/**
* Called when an entity has made a decision to explode.
*
@ -602,14 +541,12 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.entity.EntityExplodeTriggerEvent
*/
EXPLOSION_PRIME (Category.LIVING_ENTITY),
/**
* Called when an entity targets another entity
*
* @see org.bukkit.event.entity.EntityTargetEvent
*/
ENTITY_TARGET (Category.LIVING_ENTITY),
/**
* Called when an entity interacts with a block
* This event specifically excludes player entities
@ -617,14 +554,12 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.entity.EntityInteractEvent
*/
ENTITY_INTERACT (Category.LIVING_ENTITY),
/**
* Called when a creeper gains or loses a power shell
*
* @see org.bukkit.event.entity.CreeperPowerEvent
*/
CREEPER_POWER (Category.LIVING_ENTITY),
/**
* Called when a pig is zapped, zombifying it
*
@ -642,14 +577,12 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.weather.LightningStrikeEvent
*/
LIGHTNING_STRIKE (Category.WEATHER),
/**
* Called when the weather in a world changes
*
* @see org.bukkit.event.weather.WeatherChangeEvent
*/
WEATHER_CHANGE (Category.WEATHER),
/**
* Called when the thunder state in a world changes
*
@ -667,63 +600,54 @@ public abstract class Event implements Serializable {
* @see org.bukkit.event.vehicle.VehicleCreateEvent
*/
VEHICLE_CREATE (Category.VEHICLE),
/**
* Called when a vehicle is destroyed
*
* @see org.bukkit.event.vehicle.VehicleDestroyEvent
*/
VEHICLE_DESTROY (Category.VEHICLE),
/**
* Called when a vehicle is damaged by a LivingEntity
*
* @see org.bukkit.event.vehicle.VehicleDamageEvent
*/
VEHICLE_DAMAGE (Category.VEHICLE),
/**
* Called when a vehicle collides with an Entity
*
* @see org.bukkit.event.vehicle.VehicleCollisionEvent
*/
VEHICLE_COLLISION_ENTITY (Category.VEHICLE),
/**
* Called when a vehicle collides with a Block
*
* @see org.bukkit.event.vehicle.VehicleBlockCollisionEvent
*/
VEHICLE_COLLISION_BLOCK (Category.VEHICLE),
/**
* Called when a vehicle is entered by a LivingEntity
*
* @see org.bukkit.event.vehicle.VehicleEnterEvent
*/
VEHICLE_ENTER (Category.VEHICLE),
/**
* Called when a vehicle is exited by a LivingEntity
*
* @see org.bukkit.event.vehicle.VehicleExitEvent
*/
VEHICLE_EXIT (Category.VEHICLE),
/**
* Called when a vehicle moves position in the world
*
* @see org.bukkit.event.vehicle.VehicleMoveEvent
*/
VEHICLE_MOVE (Category.VEHICLE),
/**
* Called when a vehicle is going through an update cycle, rechecking itself
*
* @see org.bukkit.event.vehicle.VehicleUpdateEvent
*/
VEHICLE_UPDATE (Category.VEHICLE),
/**
* MISCELLANEOUS EVENTS
*/
@ -750,19 +674,18 @@ public abstract class Event implements Serializable {
}
public enum Result {
/**
* Deny the event.
* Depending on the event, the action indicated by the event will either not take place or will be reverted.
* Some actions may not be denied.
*/
DENY,
/**
* Neither deny nor allow the event.
* The server will proceed with its normal handling.
*/
DEFAULT,
/**
* Allow / Force the event.
* The action indicated by the event will take place if possible, even if the server would not normally allow the action.

View file

@ -1,9 +1,6 @@
package org.bukkit.event;
/**
* Simple interface for tagging all EventListeners
*/
public interface Listener {
}
public interface Listener {}

View file

@ -1,6 +1,7 @@
package org.bukkit.event.block;
public enum Action {
/**
* Left-clicking a block
*/

View file

@ -1,5 +1,3 @@
package org.bukkit.event.block;
import org.bukkit.block.Block;

View file

@ -39,7 +39,7 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
public boolean getInstaBreak() {
return instaBreak;
}
/**
* Set if the block should instantly break
*/
@ -49,13 +49,12 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
/**
* Returns the ItemStack in hand
*
*
* @return Currently wielding itemstack
*/
public ItemStack getItemInHand() {
return itemstack;
}
public boolean isCancelled() {
return cancel;

View file

@ -7,15 +7,15 @@ import org.bukkit.util.Vector;
/**
* Event called on dispense of an item from a block.
*
*
* @author sk89q
*/
public class BlockDispenseEvent extends BlockEvent implements Cancellable {
private boolean cancelled = false;
private ItemStack item;
private Vector velocity;
public BlockDispenseEvent(Block block, ItemStack dispensed, Vector velocity) {
super(Type.BLOCK_DISPENSE, block);
this.item = dispensed;
@ -25,7 +25,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
/**
* Get the item that is being dispensed. Modifying the returned item
* will have no effect.
*
*
* @return
*/
public ItemStack getItem() {
@ -34,26 +34,26 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
/**
* Set the item being dispensed.
*
*
* @param item
*/
public void setItem(ItemStack item) {
this.item = item;
}
/**
* Gets the velocity. Modifying the returned Vector will not
* change the velocity.
*
*
* @return
*/
public Vector getVelocity() {
return velocity.clone();
}
/**
* Set the velocity.
*
*
* @param vel
*/
public void setVelocity(Vector vel) {
@ -73,5 +73,4 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
public void setCancelled(boolean cancel) {
cancelled = cancel;
}
}

View file

@ -29,7 +29,7 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
/**
* Convenience method for getting the faced block
*
*
* @return Block the faced block
*/
public Block getToBlock() {

View file

@ -55,8 +55,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
* Gets the cause of block ignite.
* @return An IgniteCause value detailing the cause of block ignition.
*/
public IgniteCause getCause()
{
public IgniteCause getCause() {
return cause;
}
@ -73,6 +72,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
* An enum to specify the cause of the ignite
*/
public enum IgniteCause {
/**
* Block ignition caused by lava.
*/
@ -90,5 +90,4 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
*/
LIGHTNING,
}
}

View file

@ -9,25 +9,23 @@ import org.bukkit.plugin.AuthorNagException;
* @author durron597
*/
public class BlockListener implements Listener {
/**
* Default Constructor
*/
public BlockListener() {
}
public BlockListener() {}
/**
* Called when a block is damaged (or broken)
*
* @param event Relevant event details
*/
public void onBlockDamage(BlockDamageEvent event) {
}
public void onBlockDamage(BlockDamageEvent event) {}
/**
* Called when we try to place a block, to see if we can build it
*/
public void onBlockCanBuild(BlockCanBuildEvent event) {
}
public void onBlockCanBuild(BlockCanBuildEvent event) {}
/**
* Called when a block flows (water/lava)
@ -48,24 +46,21 @@ public class BlockListener implements Listener {
*
* @param event Relevant event details
*/
public void onBlockIgnite(BlockIgniteEvent event) {
}
public void onBlockIgnite(BlockIgniteEvent event) {}
/**
* Called when block physics occurs
*
* @param event Relevant event details
*/
public void onBlockPhysics(BlockPhysicsEvent event) {
}
public void onBlockPhysics(BlockPhysicsEvent event) {}
/**
* Called when a player places a block
*
* @param event Relevant event details
*/
public void onBlockPlace(BlockPlaceEvent event) {
}
public void onBlockPlace(BlockPlaceEvent event) {}
/**
* Called when redstone changes
@ -74,54 +69,47 @@ public class BlockListener implements Listener {
*
* @param event Relevant event details
*/
public void onBlockRedstoneChange(BlockRedstoneEvent event) {
}
public void onBlockRedstoneChange(BlockRedstoneEvent event) {}
/**
* Called when leaves are decaying naturally
*
* @param event Relevant event details
*/
public void onLeavesDecay(LeavesDecayEvent event) {
}
public void onLeavesDecay(LeavesDecayEvent event) {}
/**
* Called when a sign is changed
*
* @param event Relevant event details
*/
public void onSignChange(SignChangeEvent event) {
}
public void onSignChange(SignChangeEvent event) {}
/**
* Called when a block is destroyed from burning
*
* @param event Relevant event details
*/
public void onBlockBurn(BlockBurnEvent event) {
}
public void onBlockBurn(BlockBurnEvent event) {}
/**
* Called when a block is destroyed by a player.
*
* @param event Relevant event details
*/
public void onBlockBreak(BlockBreakEvent event) {
}
public void onBlockBreak(BlockBreakEvent event) {}
/**
* Called when a world is attempting to place a block during a snowfall
*
* @param event Relevant event details
*/
public void onSnowForm(SnowFormEvent event) {
}
public void onSnowForm(SnowFormEvent event) {}
/**
* Called when a block is dispensing an item
*
*
* @param event Relevant event details
*/
public void onBlockDispense(BlockDispenseEvent event) {
}
public void onBlockDispense(BlockDispenseEvent event) {}
}

View file

@ -75,7 +75,6 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
return this.replacedBlockState;
}
/**
* Get the block that this block was placed against
*

View file

@ -1,4 +1,3 @@
package org.bukkit.event.block;
import org.bukkit.block.Block;
@ -42,5 +41,4 @@ public class BlockRedstoneEvent extends BlockEvent {
public void setNewCurrent(int newCurrent) {
this.newCurrent = newCurrent;
}
}

View file

@ -1,4 +1,3 @@
package org.bukkit.event.block;
import org.bukkit.block.Block;

View file

@ -23,7 +23,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
*
* @return the material being placed by a snowfall
*/
public Material getMaterial(){
public Material getMaterial() {
return material;
}
@ -32,7 +32,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
*
* @param material the material to be placed during a snowfall
*/
public void setMaterial(Material material){
public void setMaterial(Material material) {
this.material = material;
}
@ -41,7 +41,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
*
* @return the data of the block being placed by a snowfall
*/
public byte getData(){
public byte getData() {
return data;
}
@ -50,7 +50,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
*
* @param data
*/
public void setData(byte data){
public void setData(byte data) {
this.data = data;
}
@ -73,4 +73,4 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}
}

View file

@ -56,4 +56,4 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
public CreatureType getCreatureType() {
return creatureType;
}
}
}

View file

@ -56,34 +56,33 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable {
return bolt;
}
/**
* Gets the cause of the creeper being (un)powered.
* @return A PowerCause value detailing the cause of change in power.
*/
/**
* Gets the cause of the creeper being (un)powered.
* @return A PowerCause value detailing the cause of change in power.
*/
public PowerCause getCause() {
return cause;
}
/**
* An enum to specify the cause of the change in power
*/
public enum PowerCause {
/**
* Power change caused by a lightning bolt
* Powered state: true
*/
LIGHTNING,
/**
* An enum to specify the cause of the change in power
*/
public enum PowerCause {
/**
* Power change caused by something else (probably a plugin)
* Powered state: true
*/
SET_ON,
/**
* Power change caused by something else (probably a plugin)
* Powered state: false
*/
SET_OFF
}
/**
* Power change caused by a lightning bolt
* Powered state: true
*/
LIGHTNING,
/**
* Power change caused by something else (probably a plugin)
* Powered state: true
*/
SET_ON,
/**
* Power change caused by something else (probably a plugin)
* Powered state: false
*/
SET_OFF
}
}

View file

@ -20,9 +20,7 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent implements Cance
* Returns the block that damaged the player.
* @return Block that damaged the player
*/
public Block getDamager()
{
public Block getDamager() {
return damager;
}
}

View file

@ -19,9 +19,7 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent implements Canc
* Returns the entity that damaged the defender.
* @return Entity that damaged the defender.
*/
public Entity getDamager()
{
public Entity getDamager() {
return damager;
}
}

View file

@ -13,6 +13,7 @@ public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
super(damager, damagee, cause, damage);
this.projectile = projectile;
Random random = new Random();
this.bounce = random.nextBoolean();
}
@ -24,12 +25,11 @@ public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
return projectile;
}
public void setBounce(boolean bounce){
public void setBounce(boolean bounce) {
this.bounce = bounce;
}
public boolean getBounce(){
public boolean getBounce() {
return bounce;
}
}

View file

@ -13,15 +13,13 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
private boolean cancelled;
private DamageCause cause;
public EntityDamageEvent(Entity damagee, DamageCause cause, int damage)
{
public EntityDamageEvent(Entity damagee, DamageCause cause, int damage) {
super(Event.Type.ENTITY_DAMAGE, damagee);
this.cause = cause;
this.damage = damage;
}
protected EntityDamageEvent(Event.Type type, Entity damagee, DamageCause cause, int damage)
{
protected EntityDamageEvent(Event.Type type, Entity damagee, DamageCause cause, int damage) {
super(type, damagee);
this.cause = cause;
this.damage = damage;
@ -57,8 +55,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
* Gets the amount of damage caused by the Block
* @return The amount of damage caused by the Block
*/
public int getDamage()
{
public int getDamage() {
return damage;
}
@ -74,16 +71,15 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
* Gets the cause of the damage.
* @return A DamageCause value detailing the cause of the damage.
*/
public DamageCause getCause()
{
public DamageCause getCause() {
return cause;
}
/**
* An enum to specify the cause of the damage
*/
public enum DamageCause
{
public enum DamageCause {
/**
* Damage caused when an entity contacts a block such as a Cactus.
*
@ -152,7 +148,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
VOID,
/**
* Damage caused by being struck by lightning
*
*
* Damage: 5
*/
LIGHTNING,

View file

@ -1,4 +1,3 @@
package org.bukkit.event.entity;
import java.util.List;

View file

@ -9,8 +9,7 @@ import org.bukkit.event.Event;
public class EntityEvent extends Event {
protected Entity entity;
public EntityEvent(final Event.Type type, final Entity what)
{
public EntityEvent(final Event.Type type, final Entity what) {
super(type);
entity = what;
}
@ -19,8 +18,7 @@ public class EntityEvent extends Event {
* Returns the Entity involved in this event
* @return Entity who is involved in this event
*/
public final Entity getEntity()
{
public final Entity getEntity() {
return entity;
}
}

View file

@ -1,4 +1,3 @@
package org.bukkit.event.entity;
import java.util.List;
@ -17,7 +16,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private List<Block> blocks;
private float yield = 0.3F;
public EntityExplodeEvent (Entity what, Location location, List<Block> blocks) {
public EntityExplodeEvent(Entity what, Location location, List<Block> blocks) {
super(Type.ENTITY_EXPLODE, what);
this.location = location;
this.cancel = false;
@ -51,12 +50,12 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
/**
* Returns the percentage of blocks to drop from this explosion
* @return
* @return
*/
public float getYield() {
return yield;
}
/**
* Sets the percentage of blocks to drop from this explosion
*/

View file

@ -11,7 +11,7 @@ import org.bukkit.event.Cancellable;
*/
public class EntityInteractEvent extends EntityEvent implements Cancellable {
protected Block block;
private boolean cancelled;
public EntityInteractEvent(Entity entity, Block block) {
@ -51,4 +51,4 @@ public class EntityInteractEvent extends EntityEvent implements Cancellable {
public Block getBlock() {
return block;
}
}
}

View file

@ -8,42 +8,29 @@ import org.bukkit.event.painting.PaintingBreakEvent;
* Handles all events fired in relation to entities
*/
public class EntityListener implements Listener {
public EntityListener() {
}
public EntityListener() {}
public void onCreatureSpawn(CreatureSpawnEvent event) {
}
public void onCreatureSpawn(CreatureSpawnEvent event) {}
public void onEntityCombust(EntityCombustEvent event) {
}
public void onEntityCombust(EntityCombustEvent event) {}
public void onEntityDamage(EntityDamageEvent event) {
}
public void onEntityDamage(EntityDamageEvent event) {}
public void onEntityExplode(EntityExplodeEvent event) {
}
public void onEntityExplode(EntityExplodeEvent event) {}
public void onExplosionPrime(ExplosionPrimeEvent event) {
}
public void onExplosionPrime(ExplosionPrimeEvent event) {}
public void onEntityDeath(EntityDeathEvent event) {
}
public void onEntityDeath(EntityDeathEvent event) {}
public void onEntityTarget(EntityTargetEvent event) {
}
public void onEntityTarget(EntityTargetEvent event) {}
public void onEntityInteract(EntityInteractEvent event) {
}
public void onEntityInteract(EntityInteractEvent event) {}
public void onPaintingPlace(PaintingPlaceEvent event){
}
public void onPaintingPlace(PaintingPlaceEvent event) {}
public void onPaintingBreak(PaintingBreakEvent event){
}
public void onPaintingBreak(PaintingBreakEvent event) {}
public void onPigZap(PigZapEvent event) {
}
public void onPigZap(PigZapEvent event) {}
public void onCreeperPower(CreeperPowerEvent event) {
}
public void onCreeperPower(CreeperPowerEvent event) {}
}

View file

@ -66,8 +66,8 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
/**
* An enum to specify the reason for the targeting
*/
public enum TargetReason
{
public enum TargetReason {
/**
* When the entity's target has died, and so it no longer targets it
*/

View file

@ -22,11 +22,11 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
public float getRadius() {
return radius;
}
public void setRadius(float radius) {
this.radius = radius;
}
@ -38,5 +38,4 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
public void setFire(boolean fire) {
this.fire = fire;
}
}

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