mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-29 19:41:24 +01:00
Fixes bugs with CompositeCommand world setting.
Removes debug from previous commit. Relates to https://github.com/BentoBoxWorld/BentoBox/pull/415
This commit is contained in:
parent
08ac89e510
commit
e5c69e42a6
@ -85,7 +85,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
|
||||
/**
|
||||
* The prefix to be used in this command
|
||||
*/
|
||||
private String permissionPrefix = "";
|
||||
private String permissionPrefix;
|
||||
|
||||
/**
|
||||
* The world that this command operates in. This is an overworld and will cover any associated nether or end
|
||||
@ -101,7 +101,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
|
||||
/**
|
||||
* The top level label
|
||||
*/
|
||||
private String topLabel = "";
|
||||
private String topLabel;
|
||||
|
||||
/**
|
||||
* Cool down tracker
|
||||
@ -133,11 +133,13 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
|
||||
setDescription(COMMANDS + label + ".description");
|
||||
setParametersHelp(COMMANDS + label + ".parameters");
|
||||
permissionPrefix = (addon != null) ? addon.getPermissionPrefix() : "";
|
||||
setup();
|
||||
// Set up world if this is an AddonGameMode
|
||||
if (addon instanceof GameModeAddon) {
|
||||
this.world = ((GameModeAddon)addon).getOverWorld();
|
||||
addon.log("DEBUG: gamemode command - world = " +((GameModeAddon)addon).getOverWorld());
|
||||
setWorld(((GameModeAddon)addon).getOverWorld());
|
||||
}
|
||||
// Run setup
|
||||
setup();
|
||||
if (!getSubCommand("help").isPresent() && !label.equals("help")) {
|
||||
new DefaultHelpCommand(this);
|
||||
}
|
||||
|
@ -153,10 +153,8 @@ public class AddonsManager {
|
||||
GameModeAddon gameMode = (GameModeAddon)addon;
|
||||
// Create the gameWorlds
|
||||
gameMode.createWorlds();
|
||||
plugin.logDebug("GameModeAddon found! overWorld = " + gameMode.getOverWorld());
|
||||
plugin.getIWM().addWorld(gameMode.getOverWorld(), gameMode.getWorldSettings());
|
||||
// Register the schems
|
||||
plugin.logDebug("Trying to register schems");
|
||||
plugin.getSchemsManager().loadIslands(gameMode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -119,7 +119,7 @@ public class LocalesManager {
|
||||
// We cannot use Bukkit's saveResource, because we want it to go into a specific folder, so...
|
||||
// Get the last part of the name
|
||||
int lastIndex = name.lastIndexOf('/');
|
||||
File targetFile = new File(localeDir, name.substring(lastIndex >= 0 ? lastIndex : 0, name.length()));
|
||||
File targetFile = new File(localeDir, name.substring(lastIndex >= 0 ? lastIndex : 0));
|
||||
copyFile(name, targetFile);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -41,12 +41,9 @@ public class SchemsManager {
|
||||
plugin.logError("Could not make schems folder!");
|
||||
return;
|
||||
}
|
||||
// Save any schems that
|
||||
// Save any schems that are in the jar
|
||||
try (JarFile jar = new JarFile(addon.getFile())) {
|
||||
plugin.getAddonsManager().listJarFiles(jar, "schems", ".schem").forEach(name -> {
|
||||
plugin.logDebug("Found " + name);
|
||||
addon.saveResource(name, false);
|
||||
});
|
||||
plugin.getAddonsManager().listJarFiles(jar, "schems", ".schem").forEach(name -> addon.saveResource(name, false));
|
||||
} catch (IOException e) {
|
||||
plugin.logError("Could not load schem files from addon jar " + e.getMessage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user