Style fixes.

This commit is contained in:
main() 2013-03-02 13:13:24 +01:00
parent e45520c43b
commit 2b827a1fae
3 changed files with 27 additions and 10 deletions

View File

@ -50,7 +50,7 @@ public class MVWorld implements MultiverseWorld {
private final MultiverseCore plugin; // Hold the Plugin Instance.
private final String name; // The Worlds Name, EG its folder name.
private final UUID worldUID;
final WorldProperties props;
private final WorldProperties props;
public MVWorld(MultiverseCore plugin, World world, WorldProperties properties) {
this(plugin, world, properties, true);
@ -470,10 +470,18 @@ public class MVWorld implements MultiverseWorld {
this.plugin.getServer().getPluginManager().recalculatePermissionDefaults(allWorlds);
}
/**
* Copies all properties from another {@link MVWorld} object.
* @param other The other world object.
*/
public void copyValues(MVWorld other) {
props.copyValues(other.props);
}
/**
* Copies all properties from a {@link WorldProperties} object.
* @param other The world properties object.
*/
public void copyValues(WorldProperties other) {
props.copyValues(other);
}

View File

@ -29,6 +29,11 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
* This is a property class, I think we don't need that much javadoc.
* BEGIN CHECKSTYLE-SUPPRESSION: Javadoc
*/
@SerializableAs("MVWorld")
public class WorldProperties extends SerializationConfig {
@ -235,7 +240,7 @@ public class WorldProperties extends SerializationConfig {
@Property(serializor = EnumPropertySerializor.class, description = "Sorry, 'style' must be a valid style-name.")
private volatile EnglishChatStyle style;
@Property(description = "Sorry, 'pvp' must either be: true or false.", virtualType = Boolean.class, persistVirtual = true)
volatile VirtualProperty<Boolean> pvp;
volatile VirtualProperty<Boolean> pvp; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(description = "Scale must be a positive double value. ex: 2.3")
private volatile double scale;
@Property(description = "You must set this to the NAME not alias of a world.")
@ -244,7 +249,7 @@ public class WorldProperties extends SerializationConfig {
private volatile boolean allowWeather;
@Property(serializor = DifficultyPropertySerializor.class, virtualType = Difficulty.class, persistVirtual = true,
description = "Difficulty must be set as one of the following: peaceful easy normal hard")
volatile VirtualProperty<Difficulty> difficulty;
volatile VirtualProperty<Difficulty> difficulty; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(description = "Sorry, 'animals' must either be: true or false.")
private volatile SpawnSettings spawning;
@Property
@ -260,12 +265,12 @@ public class WorldProperties extends SerializationConfig {
@Property(serializor = GameModePropertySerializor.class, description = "GameMode must be set as one of the following: survival creative")
private volatile GameMode gameMode;
@Property(description = "Sorry, this must either be: true or false.", virtualType = Boolean.class, persistVirtual = true)
volatile VirtualProperty<Boolean> keepSpawnInMemory;
volatile VirtualProperty<Boolean> keepSpawnInMemory; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
volatile SpawnLocation spawnLocation;
volatile SpawnLocation spawnLocation; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(virtualType = Location.class,
description = "There is no help available for this variable. Go bug Rigby90 about it.")
volatile VirtualProperty<Location> spawn;
volatile VirtualProperty<Location> spawn; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property(description = "Set this to false ONLY if you don't want this world to load itself on server restart.")
private volatile boolean autoLoad;
@Property(description = "If a player dies in this world, shoudld they go to their bed?")
@ -274,11 +279,11 @@ public class WorldProperties extends SerializationConfig {
private volatile List<String> worldBlacklist;
@Property(serializor = TimePropertySerializor.class, virtualType = Long.class,
description = "Set the time to whatever you want! (Will NOT freeze time)")
volatile VirtualProperty<Long> time;
volatile VirtualProperty<Long> time; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
volatile Environment environment;
volatile Environment environment; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
volatile long seed;
volatile long seed; // SUPPRESS CHECKSTYLE: VisibilityModifier
@Property
private volatile String generator;
@Property
@ -547,7 +552,7 @@ public class WorldProperties extends SerializationConfig {
return this.difficulty.get();
}
@Deprecated
@Deprecated // SUPPRESS CHECKSTYLE: Deprecated
public boolean setDifficulty(String difficulty) {
return this.setPropertyUnchecked("difficulty", difficulty);
}

View File

@ -21,6 +21,10 @@ public class MVMapListener implements Listener {
this.plugin = plugin;
}
/**
* This method is called when a map is initialized.
* @param event The event that was fired.
*/
@EventHandler
public void mapInitialize(final MapInitializeEvent event) {
for (final Player player : Bukkit.getOnlinePlayers()) {