Minor bug fixed preparing for 2.3

Fix chatPrefix -> chatprefix
Fix portalcooldown -> teleportcooldown
Fix made teleportcooldown show up in the config
Add New warnings to the default.
This commit is contained in:
Eric Stokes 2012-02-04 10:14:58 -07:00
parent 950991ff1b
commit 3ac4e55dc2
5 changed files with 34 additions and 23 deletions

View File

@ -14,7 +14,7 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
@Property @Property
private boolean enforceaccess; private boolean enforceaccess;
@Property @Property
private boolean prefixChat; private boolean prefixchat;
@Property @Property
private boolean teleportintercept; private boolean teleportintercept;
@Property @Property
@ -30,7 +30,7 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
@Property @Property
private String firstspawnworld; private String firstspawnworld;
@Property @Property
private int portalcooldown; private int teleportcooldown;
public MultiverseCoreConfiguration() { public MultiverseCoreConfiguration() {
super(); super();
@ -47,14 +47,14 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
public void setDefaults() { public void setDefaults() {
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck // BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
enforceaccess = false; enforceaccess = false;
prefixChat = true; prefixchat = true;
teleportintercept = true; teleportintercept = true;
firstspawnoverride = true; firstspawnoverride = true;
displaypermerrors = true; displaypermerrors = true;
globaldebug = 0; globaldebug = 0;
messagecooldown = 5000; messagecooldown = 5000;
portalcooldown = 5000; teleportcooldown = 1000;
this.version = 2.8; this.version = 2.9;
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck // END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
} }
@ -81,7 +81,7 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
*/ */
@Override @Override
public boolean getPrefixChat() { public boolean getPrefixChat() {
return this.prefixChat; return this.prefixchat;
} }
/** /**
@ -89,7 +89,7 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
*/ */
@Override @Override
public void setPrefixChat(boolean prefixChat) { public void setPrefixChat(boolean prefixChat) {
this.prefixChat = prefixChat; this.prefixchat = prefixChat;
} }
/** /**
@ -208,15 +208,15 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public int getPortalCooldown() { public int getTeleportCooldown() {
return this.portalcooldown; return this.teleportcooldown;
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void setPortalCooldown(int portalCooldown) { public void setTeleportCooldown(int teleportCooldown) {
this.portalcooldown = portalCooldown; this.teleportcooldown = teleportCooldown;
} }
} }

View File

@ -18,13 +18,13 @@ public interface MultiverseCoreConfig extends ConfigurationSerializable {
* Sets portalCooldown. * Sets portalCooldown.
* @param portalCooldown The new value. * @param portalCooldown The new value.
*/ */
void setPortalCooldown(int portalCooldown); void setTeleportCooldown(int portalCooldown);
/** /**
* Gets portalCooldown. * Gets portalCooldown.
* @return portalCooldown. * @return portalCooldown.
*/ */
int getPortalCooldown(); int getTeleportCooldown();
/** /**
* Sets firstSpawnWorld. * Sets firstSpawnWorld.

View File

@ -55,7 +55,7 @@ public class VersionCommand extends MultiverseCommand {
buffer.append("[Multiverse-Core] Dumping Config Values: (version ") buffer.append("[Multiverse-Core] Dumping Config Values: (version ")
.append(this.plugin.getMVConfig().getVersion()).append(")").append('\n'); .append(this.plugin.getMVConfig().getVersion()).append(")").append('\n');
buffer.append("[Multiverse-Core] messagecooldown: ").append(plugin.getMessaging().getCooldown()).append('\n'); buffer.append("[Multiverse-Core] messagecooldown: ").append(plugin.getMessaging().getCooldown()).append('\n');
buffer.append("[Multiverse-Core] teleportcooldown: ").append("Not yet IMPLEMENTED").append('\n'); buffer.append("[Multiverse-Core] teleportcooldown: ").append(plugin.getMVConfig().getTeleportCooldown()).append('\n');
buffer.append("[Multiverse-Core] worldnameprefix: ").append(plugin.getMVConfig().getPrefixChat()).append('\n'); buffer.append("[Multiverse-Core] worldnameprefix: ").append(plugin.getMVConfig().getPrefixChat()).append('\n');
buffer.append("[Multiverse-Core] enforceaccess: ").append(plugin.getMVConfig().getEnforceAccess()).append('\n'); buffer.append("[Multiverse-Core] enforceaccess: ").append(plugin.getMVConfig().getEnforceAccess()).append('\n');
buffer.append("[Multiverse-Core] displaypermerrors: ").append(plugin.getMVConfig().getDisplayPermErrors()).append('\n'); buffer.append("[Multiverse-Core] displaypermerrors: ").append(plugin.getMVConfig().getDisplayPermErrors()).append('\n');

View File

@ -9,6 +9,7 @@ package com.onarandombox.MultiverseCore.utils;
import com.onarandombox.MultiverseCore.MultiverseCoreConfiguration; import com.onarandombox.MultiverseCore.MultiverseCoreConfiguration;
import com.onarandombox.MultiverseCore.api.MultiverseCoreConfig;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.Date; import java.util.Date;
@ -23,9 +24,9 @@ public class MVPlayerSession {
private long teleportLast = 0L; // Timestamp for the Players last Portal Teleportation. private long teleportLast = 0L; // Timestamp for the Players last Portal Teleportation.
private long messageLast = 0L; // Timestamp for the Players last Alert Message. private long messageLast = 0L; // Timestamp for the Players last Alert Message.
private MultiverseCoreConfiguration config; // Configuration file to find out Cooldown Timers. private MultiverseCoreConfig config; // Configuration file to find out Cooldown Timers.
public MVPlayerSession(Player player, MultiverseCoreConfiguration config) { public MVPlayerSession(Player player, MultiverseCoreConfig config) {
this.player = player; this.player = player;
this.config = config; this.config = config;
// this.bedSpawn = null; // this.bedSpawn = null;
@ -42,6 +43,6 @@ public class MVPlayerSession {
*/ */
public boolean getTeleportable() { public boolean getTeleportable() {
long time = (new Date()).getTime(); long time = (new Date()).getTime();
return ((time - this.teleportLast) > this.config.getPortalCooldown()); return ((time - this.teleportLast) > this.config.getTeleportCooldown());
} }
} }

View File

@ -1,6 +1,16 @@
# This is the MV2 Config. If you mess it up, copy the values out # ------------------------------------------------------------------------- #
# delete it, and it will be regenerated. Then use the ingame interface # This is the MV2 Config. If you mess it up, copy the values out #
# to add your values back via the "/mv conf" command. # delete it, and it will be regenerated. Then use the ingame interface #
# When in-game, simply type: "/mv conf ?" for help. # to add your values back via the "/mv conf" command. #
# A config with explanations can be found here: # When in-game, simply type: "/mv conf ?" for help. #
# https://github.com/Multiverse/Multiverse-Core/wiki/config.yml # A config with explanations can be found here: #
# https://github.com/Multiverse/Multiverse-Core/wiki/config.yml #
# #
# #
# IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !!IMPORTANT #
# #
# Do NOT delete this line from your config!!!! #
# ==: com.onarandombox.MultiverseCore.MultiverseCoreConfiguration #
# #
# IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !!IMPORTANT #
# ------------------------------------------------------------------------- #