mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
essentials: Add extra check against home/warp null
This commit is contained in:
1 file changed
+6
@@ -54,6 +54,9 @@ public class EssentialsXImporter extends Importer {
|
|||||||
|
|
||||||
// Create the home
|
// Create the home
|
||||||
for (String homeName : essentialsUser.getHomes()) {
|
for (String homeName : essentialsUser.getHomes()) {
|
||||||
|
if (essentialsUser.getHome(homeName) == null || essentialsUser.getHome(homeName).getWorld() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
BukkitAdapter.adaptLocation(essentialsUser.getHome(homeName))
|
BukkitAdapter.adaptLocation(essentialsUser.getHome(homeName))
|
||||||
.map(location -> Position.at(location, plugin.getServerName()))
|
.map(location -> Position.at(location, plugin.getServerName()))
|
||||||
.ifPresent(position -> {
|
.ifPresent(position -> {
|
||||||
@@ -75,6 +78,9 @@ public class EssentialsXImporter extends Importer {
|
|||||||
final AtomicInteger warpsImported = new AtomicInteger();
|
final AtomicInteger warpsImported = new AtomicInteger();
|
||||||
final Warps warps = essentials.getWarps();
|
final Warps warps = essentials.getWarps();
|
||||||
for (String warpName : warps.getList()) {
|
for (String warpName : warps.getList()) {
|
||||||
|
if (warps.getWarp(warpName) == null || warps.getWarp(warpName).getWorld() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
BukkitAdapter.adaptLocation(warps.getWarp(warpName))
|
BukkitAdapter.adaptLocation(warps.getWarp(warpName))
|
||||||
.map(location -> Position.at(location, plugin.getServerName()))
|
.map(location -> Position.at(location, plugin.getServerName()))
|
||||||
.ifPresent(position -> {
|
.ifPresent(position -> {
|
||||||
|
|||||||
Reference in new issue
Block a user