Skip to content

Commit

Permalink
Plugin version increased, fix bug in home command
Browse files Browse the repository at this point in the history
- Fixed a null pointer in the home command
- Changed version
  • Loading branch information
ZachBora committed May 4, 2014
1 parent 36537ab commit a2a3ed0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PlotMe
main: com.worldcretornica.plotme.PlotMe
version: '0.13f'
version: '0.13g'
author: ZachBora
load: startup
website: http://dev.bukkit.org/server-mods/plotme/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.worldcretornica</groupId>
<artifactId>PlotMe</artifactId>
<version>0.13f-SNAPSHOT</version>
<version>0.13g-SNAPSHOT</version>
<name>PlotMe</name>
<url>http://dev.bukkit.org/bukkit-mods/plotme/</url>
<build>
Expand Down
11 changes: 9 additions & 2 deletions src/com/worldcretornica/plotme/PMCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,8 @@ private boolean home(Player p, String[] args)
String playername = p.getName();
UUID uuid = p.getUniqueId();
int nb = 1;
World w;
World w = null;
String worldname = "";

if(!PlotManager.isPlotWorld(p) && PlotMe.allowWorldTeleport)
{
Expand All @@ -2106,6 +2107,10 @@ private boolean home(Player p, String[] args)
w = p.getWorld();
}

if(w != null) {
worldname = w.getName();
}

if(args[0].contains(":"))
{
try{
Expand Down Expand Up @@ -2140,6 +2145,7 @@ private boolean home(Player p, String[] args)
else
{
w = Bukkit.getWorld(args[1]);
worldname = args[1];
}
}

Expand All @@ -2153,12 +2159,13 @@ private boolean home(Player p, String[] args)
else
{
w = Bukkit.getWorld(args[2]);
worldname = args[2];
}
}

if(!PlotManager.isPlotWorld(w))
{
Send(p, RED + w.getName() + C("MsgWorldNotPlot"));
Send(p, RED + worldname + C("MsgWorldNotPlot"));
}
else
{
Expand Down

0 comments on commit a2a3ed0

Please sign in to comment.