2.4.0.3 - Fixed bug #40

This commit is contained in:
Butzlabben 2018-10-29 18:36:48 +01:00
parent 685a965629
commit e48777bcc5
4 changed files with 23 additions and 17 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.butzlabben.world</groupId> <groupId>de.butzlabben.world</groupId>
<artifactId>WorldSystem</artifactId> <artifactId>WorldSystem</artifactId>
<version>2.4.0.1</version> <version>2.4.0.3</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.number>-</project.build.number> <project.build.number>-</project.build.number>

View File

@ -26,9 +26,6 @@ public class DependenceConfig {
} }
if (op == null) { if (op == null) {
op = Bukkit.getOfflinePlayer(s); op = Bukkit.getOfflinePlayer(s);
if (op == null)
return;
} }
this.op = op; this.op = op;
} }
@ -88,10 +85,10 @@ public class DependenceConfig {
File dconfig = new File("plugins//WorldSystem//dependence.yml"); File dconfig = new File("plugins//WorldSystem//dependence.yml");
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(dconfig); YamlConfiguration cfg = YamlConfiguration.loadConfiguration(dconfig);
String uuid = op.getUniqueId().toString(); String uuid = op.getUniqueId().toString();
String entry = cfg.getString("Dependences." + uuid + ".ActualName");
if (entry != null) { //Fix for #40
if (cfg.isInt("Dependences." + uuid + ".ID"))
return true; return true;
}
return false; return false;
} }

View File

@ -12,6 +12,8 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.WorldCreator; import org.bukkit.WorldCreator;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import de.butzlabben.world.WorldSystem; import de.butzlabben.world.WorldSystem;
@ -318,6 +320,11 @@ public class SystemWorld {
SystemWorld sw = SystemWorld.getSystemWorld(worldname); SystemWorld sw = SystemWorld.getSystemWorld(worldname);
sw.setCreating(true); sw.setCreating(true);
//Run in scheduler so method returns without delay
new BukkitRunnable() {
@Override
public void run() {
// For #16 // For #16
WorldSystem.getInstance().getAdapter().create(event.getWorldCreator(), sw, () -> { WorldSystem.getInstance().getAdapter().create(event.getWorldCreator(), sw, () -> {
if (p != null && p.isOnline()) { if (p != null && p.isOnline()) {
@ -329,6 +336,8 @@ public class SystemWorld {
} }
}); });
} }
}.runTaskLater(WorldSystem.getInstance(), 1);
}
return true; return true;
} }