mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-20 18:32:49 +00:00
Optimize fetching of Mirrored world data.
This commit is contained in:
parent
58057a771d
commit
2a478fe03d
|
@ -97,4 +97,5 @@ v 1.8:
|
|||
- Reload GlobalGroups when you perform a world load.
|
||||
- Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading
|
||||
- Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit.
|
||||
- Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
|
||||
- Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
|
||||
- Optimize fetching of Mirrored world data.
|
|
@ -25,14 +25,14 @@ settings:
|
|||
level: INFO
|
||||
|
||||
mirrors:
|
||||
# Worlds listed here have their permissions mirrored in their children.
|
||||
# Worlds listed here have their settings mirrored in their children.
|
||||
# the first element 'world' is the main worlds name
|
||||
# subsequent elements '- world_nether' are worlds which will use the same
|
||||
# user/groups permissions as the parent.
|
||||
# subsequent elements 'world_nether' and 'world_the_end' are worlds which will use the same
|
||||
# user/groups files as the parent.
|
||||
world:
|
||||
- world_nether
|
||||
- world_the_end
|
||||
- world2
|
||||
- world3
|
||||
# - world2
|
||||
# - world3
|
||||
# world4:
|
||||
# - world5
|
|
@ -270,11 +270,12 @@ public class WorldsHolder {
|
|||
*/
|
||||
public OverloadedWorldHolder getWorldData(String worldName) {
|
||||
String worldNameLowered = worldName.toLowerCase();
|
||||
OverloadedWorldHolder data = worldsData.get(worldNameLowered);
|
||||
// If a mirror change to the real world to load.
|
||||
if (mirrors.containsKey(worldNameLowered)) {
|
||||
String realOne = mirrors.get(worldNameLowered);
|
||||
data = worldsData.get(realOne.toLowerCase());
|
||||
}
|
||||
worldNameLowered = mirrors.get(worldNameLowered);
|
||||
}
|
||||
OverloadedWorldHolder data = worldsData.get(worldNameLowered);
|
||||
|
||||
if (data == null) {
|
||||
GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world...");
|
||||
data = getDefaultWorld();
|
||||
|
@ -283,8 +284,9 @@ public class WorldsHolder {
|
|||
}
|
||||
|
||||
/**
|
||||
* Do a matching of playerName, if it s found only one player, do
|
||||
* Do a matching of playerName, if its found only one player, do
|
||||
* getWorldData(player)
|
||||
*
|
||||
* @param playerName
|
||||
* @return null if matching returned no player, or more than one.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue