Fixes bugs with Blueprint locale.

Ensures newly saved Blueprints appear in blueprint manager.
This commit is contained in:
tastybento 2019-05-24 19:42:51 -07:00
parent 068b0e7667
commit 184a5712ae
3 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package world.bentobox.bentobox.api.commands.admin.blueprints;
import world.bentobox.bentobox.api.addons.GameModeAddon;
import world.bentobox.bentobox.api.commands.ConfirmableCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.blueprints.BlueprintClipboard;
@ -38,6 +39,7 @@ public class AdminBlueprintSaveCommand extends ConfirmableCommand {
this.askConfirmation(user, user.getTranslation("commands.admin.blueprint.file-exists"), () -> {
parent.hideClipboard(user);
new BlueprintClipboardManager(getPlugin(), parent.getBlueprintsFolder(), clipboard).save(user, args.get(0));
getPlugin().getBlueprintsManager().addBlueprint((GameModeAddon)getAddon(), clipboard.getBlueprint());
});
return false;
} else {

View File

@ -65,14 +65,14 @@ public class BlueprintManagementPanel {
SLOT_TO_ENV = ImmutableMap.of(3, World.Environment.NORMAL, 5, World.Environment.NETHER, 7, World.Environment.THE_END);
ENV_TO_BP = ImmutableMap.of(World.Environment.NORMAL, NORMAL_BP, World.Environment.NETHER, NETHER_BP, World.Environment.THE_END, END_BP);
}
private String t(String t) {
return user.getTranslation("commands.admin.blueprint.management." + t);
return user.getTranslation("commands.admin.blueprint.management." + t);
}
private String t(String t, String... vars) {
return user.getTranslation("commands.admin.blueprint.management." + t, vars);
}
return user.getTranslation("commands.admin.blueprint.management." + t, vars);
}
public void openPanel() {
// Show panel of blueprint bundles
@ -147,7 +147,7 @@ public class BlueprintManagementPanel {
private PanelItem getWorldInstrTile(Environment env) {
return new PanelItemBuilder()
.name(t("world-name-syntax", TextVariables.NAME, Util.prettifyText(env.name())))
.description(t("world-instuctions"))
.description(t("world-instructions"))
.icon(Material.GRAY_STAINED_GLASS_PANE)
.build();
}

View File

@ -225,6 +225,7 @@ commands:
parameters: "<blueprint name>"
description: "save the copied clipboard"
management:
back: "Back"
instruction: "Click on blueprint then click here"
normal: "Normal"
nether: "Nether"