mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-04-17 09:35:46 +02:00
Fixes bug with where nether or end worlds with non-standard names
https://github.com/BentoBoxWorld/BentoBox/issues/877
This commit is contained in:
parent
e5986d7a72
commit
0ddae268f7
@ -195,7 +195,7 @@ public class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks is world = world2 irrespective of the world type
|
* Checks is world = world2 irrespective of the world type. Only strips _nether and _the_end from world name.
|
||||||
* @param world - world
|
* @param world - world
|
||||||
* @param world2 - world
|
* @param world2 - world
|
||||||
* @return true if the same
|
* @return true if the same
|
||||||
@ -205,14 +205,13 @@ public class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String stripName(World world) {
|
private static String stripName(World world) {
|
||||||
switch (world.getEnvironment()) {
|
if (world.getName().endsWith(NETHER)) {
|
||||||
case NETHER:
|
|
||||||
return world.getName().substring(0, world.getName().length() - NETHER.length());
|
return world.getName().substring(0, world.getName().length() - NETHER.length());
|
||||||
case THE_END:
|
|
||||||
return world.getName().substring(0, world.getName().length() - THE_END.length());
|
|
||||||
default:
|
|
||||||
return world.getName();
|
|
||||||
}
|
}
|
||||||
|
if (world.getName().endsWith(THE_END)) {
|
||||||
|
return world.getName().substring(0, world.getName().length() - THE_END.length());
|
||||||
|
}
|
||||||
|
return world.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user