Fixing the next bunch of CheckStyle-warnings.

I just pushed this without checking it, could somebody please review this commit?
This commit is contained in:
main() 2012-01-01 20:37:28 +01:00
parent 0841362c26
commit ac5f249164
22 changed files with 477 additions and 54 deletions

View File

@ -8,9 +8,9 @@
<!DOCTYPE module SYSTEM "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!-- Future reference: valid severity values are 'ignore', 'info', 'warning', 'error' -->
<module name="Checker">
<module name="JavadocPackage">
<property name="allowLegacy" value="true"/>
</module>
<!-- <module name="JavadocPackage"> -->
<!-- <property name="allowLegacy" value="true"/> -->
<!-- </module> -->
<module name="NewlineAtEndOfFile">
<property name="severity" value="info"/>
</module>
@ -94,9 +94,10 @@
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 7, 8, 5000"/>
<property name="ignoreNumbers" value="-1, 0, 0.5, 1, 2, 3, 4, 5 7, 8, 5000"/>
<!-- Explanations why we ignore certain magic numbers: -->
<!-- 3: Log-level -->
<!-- 4, 5: Array-indexes in Destinations -->
<!-- 8: Default nether scale in MVWorld -->
<!-- 7: max number of args in CreateCommand -->
<!-- 5000: Default messagecooldown in MultiverseCore -->

View File

@ -420,6 +420,7 @@ public class MVWorld implements MultiverseWorld {
/**
* {@inheritDoc}
* @deprecated Use {@link #getProperty(String, Class)} instead
*/
@Override
@Deprecated
@ -705,6 +706,7 @@ public class MVWorld implements MultiverseWorld {
/**
* {@inheritDoc}
* @deprecated This is deprecated.
*/
@Override
@Deprecated

View File

@ -17,21 +17,34 @@ import org.bukkit.util.Vector;
import java.util.Arrays;
import java.util.List;
/**
* An anchor-{@link MVDestination}.
*/
public class AnchorDestination implements MVDestination {
private boolean isValid;
private Location location;
private MultiverseCore plugin;
private String name;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "a";
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
@ -47,16 +60,25 @@ public class AnchorDestination implements MVDestination {
return parsed.get(0).equalsIgnoreCase("a");
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return this.location;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
@ -83,11 +105,17 @@ public class AnchorDestination implements MVDestination {
this.isValid = true;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Anchor";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Anchor: " + this.name;
@ -101,11 +129,17 @@ public class AnchorDestination implements MVDestination {
return "i:Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "multiverse.access." + this.location.getWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
// This is an ANCHOR destination, don't safely teleport here.

View File

@ -14,16 +14,25 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/**
* A bed-{@link MVDestination}.
*/
public class BedDestination implements MVDestination {
private boolean isValid;
private Location knownBedLoc;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "b";
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
String[] split = destination.split(":");
@ -31,6 +40,9 @@ public class BedDestination implements MVDestination {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity entity) {
if (entity instanceof Player) {
@ -40,31 +52,49 @@ public class BedDestination implements MVDestination {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector();
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
// Not needed.
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Bed";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Bed";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
if (knownBedLoc != null) {
@ -73,6 +103,9 @@ public class BedDestination implements MVDestination {
return "";
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
// Bukkit should have already checked this.

View File

@ -17,12 +17,19 @@ import org.bukkit.util.Vector;
import java.util.Arrays;
import java.util.List;
/**
* A cannon-{@link MVDestination}.
*/
public class CannonDestination implements MVDestination {
private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)";
private boolean isValid;
private Location location;
private double speed;
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
double pitchRadians = Math.toRadians(location.getPitch());
double yawRadians = Math.toRadians(location.getYaw());
@ -35,20 +42,28 @@ public class CannonDestination implements MVDestination {
return new Vector(x, y, z);
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "ca";
}
// NEED ca:world:x,y,z:pitch:yaw:speed
// so basically 6
private static final int SPLIT_SIZE = 6;
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return false;
}
List<String> parsed = Arrays.asList(destination.split(":"));
// NEED ca:world:x,y,z:pitch:yaw:speed
// so basically 6
if (parsed.size() != 6) {
if (parsed.size() != SPLIT_SIZE) {
return false;
}
// If it's not an Cannon type
@ -75,26 +90,33 @@ public class CannonDestination implements MVDestination {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return this.location;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
return;
}
List<String> parsed = Arrays.asList(destination.split(":"));
// Need at least: e:world:x,y,z
// OR e:world:x,y,z:pitch:yaw
// so basically 3 or 5
if (parsed.size() != 6) {
if (parsed.size() != SPLIT_SIZE) {
this.isValid = false;
return;
}
@ -141,18 +163,30 @@ public class CannonDestination implements MVDestination {
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Cannon!";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Cannon (" + this.location.getX() + ", " + this.location.getY() + ", " + this.location.getZ() + ":" +
this.location.getPitch() + ":" + this.location.getYaw() + ":" + this.speed + ")";
return "Cannon (" + this.location.getX() + ", " + this.location.getY() + ", " + this.location.getZ() + ":"
+ this.location.getPitch() + ":" + this.location.getYaw() + ":" + this.speed + ")";
}
/**
* Sets this {@link CannonDestination}.
*
* @param location The {@link Location}.
* @param speed The speed.
*/
public void setDestination(Location location, double speed) {
if (location != null) {
this.location = location;
@ -165,16 +199,23 @@ public class CannonDestination implements MVDestination {
@Override
public String toString() {
if (isValid) {
return "ca:" + location.getWorld().getName() + ":" + location.getX() + "," + location.getY() + "," + location.getZ() + ":" + location.getPitch() + ":" + location.getYaw() + ":" + this.speed;
return "ca:" + location.getWorld().getName() + ":" + location.getX() + "," + location.getY()
+ "," + location.getZ() + ":" + location.getPitch() + ":" + location.getYaw() + ":" + this.speed;
}
return "i:Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "multiverse.access." + this.location.getWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
return false;

View File

@ -66,6 +66,13 @@ public class DestinationFactory {
return new InvalidDestination();
}
/**
* Registers a {@link MVDestination}.
*
* @param c The {@link Class} of the {@link MVDestination} to register.
* @param identifier The {@link String}-identifier.
* @return True if the class was successfully registered.
*/
public boolean registerDestinationType(Class<? extends MVDestination> c, String identifier) {
if (this.destList.containsKey(identifier)) {
return false;
@ -79,12 +86,14 @@ public class DestinationFactory {
Permission other = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.other." + identifier);
PermissionTools pt = new PermissionTools(this.plugin);
if (self == null) {
self = new Permission("multiverse.teleport.self." + identifier, "Permission to teleport yourself for the " + identifier + " destination.", PermissionDefault.OP);
self = new Permission("multiverse.teleport.self." + identifier,
"Permission to teleport yourself for the " + identifier + " destination.", PermissionDefault.OP);
this.plugin.getServer().getPluginManager().addPermission(self);
pt.addToParentPerms("multiverse.teleport.self." + identifier);
}
if (other == null) {
other = new Permission("multiverse.teleport.other." + identifier, "Permission to teleport others for the " + identifier + " destination.", PermissionDefault.OP);
other = new Permission("multiverse.teleport.other." + identifier,
"Permission to teleport others for the " + identifier + " destination.", PermissionDefault.OP);
this.plugin.getServer().getPluginManager().addPermission(other);
pt.addToParentPerms("multiverse.teleport.other." + identifier);
}

View File

@ -17,20 +17,33 @@ import org.bukkit.util.Vector;
import java.util.Arrays;
import java.util.List;
/**
* An exact {@link MVDestination}.
*/
public class ExactDestination implements MVDestination {
private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)";
private boolean isValid;
private Location location;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "e";
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
@ -70,16 +83,25 @@ public class ExactDestination implements MVDestination {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return this.location;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
if (!(plugin instanceof MultiverseCore)) {
@ -139,16 +161,28 @@ public class ExactDestination implements MVDestination {
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Exact";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return "Exact (" + this.location.getX() + ", " + this.location.getY() + ", " + this.location.getZ() + ":" + location.getPitch() + ":" + location.getYaw() + ")";
return "Exact (" + this.location.getX() + ", " + this.location.getY() + ", " + this.location.getZ()
+ ":" + location.getPitch() + ":" + location.getYaw() + ")";
}
/**
* Sets this {@link ExactDestination}.
*
* @param location The {@link Location}.
*/
public void setDestination(Location location) {
if (location != null) {
this.location = location;
@ -157,19 +191,29 @@ public class ExactDestination implements MVDestination {
this.isValid = false;
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
if (isValid) {
return "e:" + location.getWorld().getName() + ":" + location.getX() + "," + location.getY() + "," + location.getZ() + ":" + location.getPitch() + ":" + location.getYaw();
return "e:" + location.getWorld().getName() + ":" + location.getX() + "," + location.getY()
+ "," + location.getZ() + ":" + location.getPitch() + ":" + location.getYaw();
}
return "i:Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "multiverse.access." + this.location.getWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
// This is an EXACT destination, don't safely teleport here.

View File

@ -14,38 +14,62 @@ import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/**
* An invalid {@link MVDestination}.
*/
public class InvalidDestination implements MVDestination {
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "i";
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
return false;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return false;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
// Nothing needed, it's invalid.
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ChatColor.RED + "Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return ChatColor.RED + "Invalid Destination";
@ -56,15 +80,25 @@ public class InvalidDestination implements MVDestination {
return "i:Invalid Destination";
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
return false;

View File

@ -14,16 +14,25 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/**
* A player-{@link MVDestination}.
*/
public class PlayerDestination implements MVDestination {
private String player;
private boolean isValid;
private JavaPlugin plugin;
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "pl";
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
String[] items = destination.split(":");
@ -36,6 +45,9 @@ public class PlayerDestination implements MVDestination {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
Player p = plugin.getServer().getPlayer(this.player);
@ -52,11 +64,17 @@ public class PlayerDestination implements MVDestination {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
String[] items = destination.split(":");
@ -71,11 +89,17 @@ public class PlayerDestination implements MVDestination {
this.plugin = plugin;
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "Player";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.player;
@ -86,15 +110,25 @@ public class PlayerDestination implements MVDestination {
return "pl:" + this.player;
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
return "";
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
return true;

View File

@ -16,17 +16,26 @@ import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/**
* A world-{@link MVDestination}.
*/
public class WorldDestination implements MVDestination {
private boolean isValid;
private MultiverseWorld world;
private float yaw = -1;
private String direction = "";
/**
* {@inheritDoc}
*/
@Override
public String getIdentifier() {
return "w";
}
/**
* {@inheritDoc}
*/
@Override
public boolean isThisType(JavaPlugin plugin, String destination) {
String[] items = destination.split(":");
@ -48,6 +57,9 @@ public class WorldDestination implements MVDestination {
return false;
}
/**
* {@inheritDoc}
*/
@Override
public Location getLocation(Entity e) {
Location spawnLoc = getAcurateSpawnLocation(e, this.world);
@ -62,15 +74,23 @@ public class WorldDestination implements MVDestination {
if (world != null) {
return world.getSpawnLocation();
} else {
// add 0.5 to x and z to center people
// (spawn location is stored as int meaning that you would spawn in the corner of a block)
return e.getWorld().getSpawnLocation().add(.5, 0, .5);
}
}
/**
* {@inheritDoc}
*/
@Override
public boolean isValid() {
return this.isValid;
}
/**
* {@inheritDoc}
*/
@Override
public void setDestination(JavaPlugin plugin, String destination) {
String[] items = destination.split(":");
@ -97,11 +117,17 @@ public class WorldDestination implements MVDestination {
}
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return "World";
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return this.world.getColoredWorldString();
@ -115,6 +141,9 @@ public class WorldDestination implements MVDestination {
return this.world.getCBWorld().getName();
}
/**
* {@inheritDoc}
*/
@Override
public String getRequiredPermission() {
// TODO: Potenitally replace spaces wiht tabs for friendlier yaml.
@ -122,10 +151,17 @@ public class WorldDestination implements MVDestination {
return "multiverse.access." + this.world.getName();
}
/**
* {@inheritDoc}
*/
@Override
public Vector getVelocity() {
return new Vector(0, 0, 0);
}
/**
* {@inheritDoc}
*/
@Override
public boolean useSafeTeleporter() {
return true;

View File

@ -7,6 +7,24 @@
package com.onarandombox.MultiverseCore.enums;
/**
* A enum containing all actions that can be used to modify world-properties.
*/
public enum Action {
Set, Add, Remove, Clear
/**
* Setting a property.
*/
Set,
/**
* Adding something to a list-property.
*/
Add,
/**
* Removing something from a list-property.
*/
Remove,
/**
* Clearing a list-property.
*/
Clear
}

View File

@ -7,6 +7,20 @@
package com.onarandombox.MultiverseCore.enums;
/**
* An enum containing all list-properties.
*/
public enum AddProperties {
worldblacklist, animals, monsters
/**
* Worlds that people cannot go to from a world.
*/
worldblacklist,
/**
* Animal-exceptions.
*/
animals,
/**
* Monster-exceptions.
*/
monsters
}

View File

@ -7,9 +7,56 @@
package com.onarandombox.MultiverseCore.enums;
/**
* An enum containing all config-properties that can be set.
*/
public enum ConfigProperty {
messagecooldown, teleportcooldown, worldnameprefix, enforcegamemodes, enforceaccess, displaypermerrors, debug, firstspawnworld, teleportintercept, firstspawnoverride;
/**
* How long to leave in between sending a message to the player. (NOT YET IMPLEMENTED)
*/
messagecooldown,
/**
* How fast are people allowed to use /MVTP (NOT YET IMPLEMENTED).
*/
teleportcooldown,
/**
* Prefix chat-messages with world-names.
*/
worldnameprefix,
/**
* If value is set to false, Multiverse will NOT enforce world-gamemodes.
*/
enforcegamemodes,
/**
* If value is set to false, Multiverse will NOT enforce world access permissions.
*/
enforceaccess,
/**
* Whether users should get detailed information about the permissions they would need.
*/
displaypermerrors,
/**
* Debug-information.
*/
debug,
/**
* The world new users will spawn in.
*/
firstspawnworld,
/**
* Whether Multiverse should intercept teleports.
*/
teleportintercept,
/**
* Whether Multiverse should override the first spawn.
*/
firstspawnoverride;
/**
* Constructs a string containing all values in this enum.
*
* @return That {@link String}.
*/
public static String getAllValues() {
String buffer = "";
for (ConfigProperty c : ConfigProperty.values()) {

View File

@ -9,22 +9,44 @@ package com.onarandombox.MultiverseCore.enums;
import org.bukkit.ChatColor;
/**
* A regular {@link ChatColor} represented by an english string.
*/
public enum EnglishChatColor {
/*
* I know. this is quite ugly.
*/
/** AQUA. */
AQUA("AQUA", ChatColor.AQUA),
/** BLACK. */
BLACK("BLACK", ChatColor.BLACK),
/** BLUE. */
BLUE("BLUE", ChatColor.BLUE),
/** DARKAQUA. */
DARKAQUA("DARKAQUA", ChatColor.DARK_AQUA),
/** DARKBLUE. */
DARKBLUE("DARKBLUE", ChatColor.DARK_BLUE),
/** DARKGRAY. */
DARKGRAY("DARKGRAY", ChatColor.DARK_GRAY),
/** DARKGREEN. */
DARKGREEN("DARKGREEN", ChatColor.DARK_GREEN),
/** DARKPURPLE. */
DARKPURPLE("DARKPURPLE", ChatColor.DARK_PURPLE),
/** DARKRED. */
DARKRED("DARKRED", ChatColor.DARK_RED),
/** GOLD. */
GOLD("GOLD", ChatColor.GOLD),
/** GRAY. */
GRAY("GRAY", ChatColor.GRAY),
/** GREEN. */
GREEN("GREEN", ChatColor.GREEN),
/** LIGHTPURPLE. */
LIGHTPURPLE("LIGHTPURPLE", ChatColor.LIGHT_PURPLE),
/** RED. */
RED("RED", ChatColor.RED),
/** YELLOW. */
YELLOW("YELLOW", ChatColor.YELLOW),
/** WHITE. */
WHITE("WHITE", ChatColor.WHITE);
private ChatColor color;
private String text;
@ -34,14 +56,26 @@ public enum EnglishChatColor {
this.text = name;
}
/**
* Gets the text.
* @return The text.
*/
public String getText() {
return this.text;
}
/**
* Gets the color.
* @return The color as {@link ChatColor}.
*/
public ChatColor getColor() {
return this.color;
}
/**
* Constructs a string containing all available colors.
* @return That {@link String}.
*/
public static String getAllColors() {
String buffer = "";
for (EnglishChatColor c : EnglishChatColor.values()) {
@ -50,6 +84,11 @@ public enum EnglishChatColor {
return buffer;
}
/**
* Constructs an {@link EnglishChatColor} from a {@link String}.
* @param text The {@link String}.
* @return The {@link EnglishChatColor}.
*/
public static EnglishChatColor fromString(String text) {
if (text != null) {
for (EnglishChatColor c : EnglishChatColor.values()) {

View File

@ -7,6 +7,32 @@
package com.onarandombox.MultiverseCore.enums;
/**
* An enum containing possible teleport-results.
*/
public enum TeleportResult {
FAIL_PERMISSION, FAIL_UNSAFE, FAIL_TOO_POOR, FAIL_INVALID, FAIL_OTHER, SUCCESS
/**
* Insufficient permissions.
*/
FAIL_PERMISSION,
/**
* The teleport was unsafe.
*/
FAIL_UNSAFE,
/**
* The player was to poor.
*/
FAIL_TOO_POOR,
/**
* The teleport was invalid.
*/
FAIL_INVALID,
/**
* Unknown reason.
*/
FAIL_OTHER,
/**
* The player was successfully teleported.
*/
SUCCESS
}

View File

@ -1,30 +0,0 @@
/******************************************************************************
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
* Multiverse 2 is licensed under the BSD License. *
* For more information please check the README.md file included *
* with this project. *
******************************************************************************/
package com.onarandombox.MultiverseCore.event;
import org.bukkit.event.Event;
import java.util.List;
public class MVConfigMigrateEvent extends Event {
private static final long serialVersionUID = 3647950355746345397L;
private List<String> configsLoaded;
public MVConfigMigrateEvent(List<String> configsLoaded) {
super("MVConfigMigrate");
this.configsLoaded = configsLoaded;
}
public void addConfig(String config) {
this.configsLoaded.add(config);
}
public List<String> getAllConfigsLoaded() {
return this.configsLoaded;
}
}

View File

@ -11,6 +11,9 @@ import org.bukkit.event.Event;
import java.util.List;
/**
* Called when the Multiverse-config should be reloaded.
*/
public class MVConfigReloadEvent extends Event {
private static final long serialVersionUID = 3647950355746345397L;
private List<String> configsLoaded;
@ -20,10 +23,18 @@ public class MVConfigReloadEvent extends Event {
this.configsLoaded = configsLoaded;
}
/**
* Adds a config to this event.
* @param config The config to add.
*/
public void addConfig(String config) {
this.configsLoaded.add(config);
}
/**
* Gets all loaded configs.
* @return A list of all loaded configs.
*/
public List<String> getAllConfigsLoaded() {
return this.configsLoaded;
}

View File

@ -11,6 +11,9 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
/**
* Called
*/
public class MVRespawnEvent extends Event {
private Player player;
private Location location;

View File

@ -8,6 +8,7 @@
package com.onarandombox.MultiverseCore.event;
import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -68,6 +69,14 @@ public class MVTeleportEvent extends Event implements Cancellable {
return this.dest;
}
/**
* Looks if this {@link MVTeleportEvent} is using the {@link SafeTTeleporter}.
* @return True if this {@link MVTeleportEvent} is using the {@link SafeTTeleporter}.
*/
public boolean isUsingSafeTTeleporter() {
return useSafeTeleport;
}
@Override
public boolean isCancelled() {
return this.isCancelled;

View File

@ -9,6 +9,9 @@ package com.onarandombox.MultiverseCore.event;
import org.bukkit.event.Event;
/**
* Called when somebody requests version information about Multiverse.
*/
public class MVVersionRequestEvent extends Event {
private String pasteBinBuffer;

View File

@ -15,7 +15,7 @@ import org.bukkit.event.Event;
/**
* This event is fired *before* the property is actually changed.
* <p>
* If it is cancled, no change will happen.
* If it is cancelled, no change will happen.
* <p>
* If you want to get the values of the world before the change, query the world.
* If you want to get the value being changed, use getProperty()
@ -36,14 +36,26 @@ public class MVWorldPropertyChangeEvent extends Event implements Cancellable {
this.value = value;
}
/**
* Gets the changed world property's name.
* @return The changed world property's name.
*/
public String getPropertyName() {
return this.name;
}
/**
* Gets the new value.
* @return The new value.
*/
public String getNewValue() {
return this.value;
}
/**
* Sets the new value.
* @param value The new new value.
*/
public void setNewValue(String value) {
this.value = value;
}

View File

@ -7,6 +7,9 @@
package com.onarandombox.MultiverseCore.exceptions;
/**
* Thrown when a world-property doesn't exist.
*/
public class PropertyDoesNotExistException extends Exception {
public PropertyDoesNotExistException(String name) {
super(name);