summaryrefslogtreecommitdiffstats
path: root/EssentialsSpawn
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsSpawn')
-rw-r--r--EssentialsSpawn/nbproject/project.properties6
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java6
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java2
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java7
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java33
5 files changed, 26 insertions, 28 deletions
diff --git a/EssentialsSpawn/nbproject/project.properties b/EssentialsSpawn/nbproject/project.properties
index 27fa91493..16c272f09 100644
--- a/EssentialsSpawn/nbproject/project.properties
+++ b/EssentialsSpawn/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -61,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsSpawn.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
includes=**
jar.compress=true
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
index 9ffc1c3f0..33dff8241 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.spawn;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import com.earth2me.essentials.commands.EssentialsCommand;
+import org.bukkit.Server;
public class Commandsetspawn extends EssentialsCommand
@@ -18,6 +18,6 @@ public class Commandsetspawn extends EssentialsCommand
{
final String group = args.length > 0 ? getFinalArg(args, 0) : "default";
ess.getSpawn().setSpawn(user.getLocation(), group);
- user.sendMessage(Util.format("spawnSet", group));
+ user.sendMessage(_("spawnSet", group));
}
}
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
index b3ade7634..f9ea9fa36 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.spawn;
import com.earth2me.essentials.Trade;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.commands.EssentialsCommand;
+import org.bukkit.Server;
public class Commandspawn extends EssentialsCommand
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
index 1bae3fed3..8ffdb5c97 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
@@ -1,8 +1,7 @@
package com.earth2me.essentials.spawn;
-
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.command.Command;
@@ -29,9 +28,9 @@ public class EssentialsSpawn extends JavaPlugin
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
- LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+ LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
public void onDisable()
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
index 459eee60a..57b842c82 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.spawn;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
@@ -15,8 +15,9 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{
private final transient IEssentials ess;
- public EssentialsSpawnPlayerListener(IEssentials ess)
+ public EssentialsSpawnPlayerListener(final IEssentials ess)
{
+ super();
this.ess = ess;
}
@@ -25,28 +26,24 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{
final User user = ess.getUser(event.getPlayer());
- try
+ if (ess.getSettings().getRespawnAtHome())
{
- if (ess.getSettings().getRespawnAtHome())
+ Location home = user.getHome(user.getLocation());
+ if (home == null)
+ {
+ home = user.getBedSpawnLocation();
+ }
+ if (home != null)
{
- Location home = user.getHome(user.getLocation());
- if (home == null)
- {
- throw new Exception();
- }
event.setRespawnLocation(home);
return;
}
}
- catch (Throwable ex)
+ final Location spawn = ess.getSpawn().getSpawn(user.getGroup());
+ if (spawn != null)
{
+ event.setRespawnLocation(spawn);
}
- Location spawn = ess.getSpawn().getSpawn(user.getGroup());
- if (spawn == null)
- {
- return;
- }
- event.setRespawnLocation(spawn);
}
@Override
@@ -54,7 +51,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{
final User user = ess.getUser(event.getPlayer());
- if (!user.isNew())
+ if (!user.isNew() || user.getBedSpawnLocation() != null)
{
return;
}
@@ -71,7 +68,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
}
catch (Exception ex)
{
- Logger.getLogger("Minecraft").log(Level.WARNING, Util.i18n("teleportNewPlayerError"), ex);
+ Logger.getLogger("Minecraft").log(Level.WARNING, _("teleportNewPlayerError"), ex);
}
}
});