mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-08 09:27:38 +01:00
Fixed right click not clearing blueprints in management panel
Fixed NPE if a bundle does not have an end or nether bp.
This commit is contained in:
parent
3ae98741c6
commit
f50e59eef1
@ -368,7 +368,9 @@ public class BlueprintsManager {
|
||||
&& addon.getWorldSettings().isNetherIslands()
|
||||
&& addon.getNetherWorld() != null) {
|
||||
bp = getBlueprints(addon).get(bb.getBlueprint(World.Environment.NETHER));
|
||||
new BlueprintPaster(plugin, bp, addon.getNetherWorld(), island, null);
|
||||
if (bp != null) {
|
||||
new BlueprintPaster(plugin, bp, addon.getNetherWorld(), island, null);
|
||||
}
|
||||
}
|
||||
// Make end island
|
||||
if (bb.getBlueprint(World.Environment.THE_END) != null
|
||||
@ -376,7 +378,9 @@ public class BlueprintsManager {
|
||||
&& addon.getWorldSettings().isEndIslands()
|
||||
&& addon.getEndWorld() != null) {
|
||||
bp = getBlueprints(addon).get(bb.getBlueprint(World.Environment.THE_END));
|
||||
new BlueprintPaster(plugin, bp, addon.getEndWorld(), island, null);
|
||||
if (bp != null) {
|
||||
new BlueprintPaster(plugin, bp, addon.getEndWorld(), island, null);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -297,12 +297,6 @@ public class BlueprintManagementPanel {
|
||||
.icon(blueprint.getIcon() == null ? Material.PAPER : blueprint.getIcon())
|
||||
.glow(selected != null && pos == selected.getKey())
|
||||
.clickHandler((panel, u, clickType, slot) -> {
|
||||
// Renaming blueprint
|
||||
if (clickType.equals(ClickType.RIGHT)) {
|
||||
u.closeInventory();
|
||||
this.askForBlueprintName(u.getPlayer(), addon, blueprint, bb);
|
||||
return true;
|
||||
}
|
||||
// Handle the world squares
|
||||
if (slot > MIN_WORLD_SLOT && slot < MAX_WORLD_SLOT) {
|
||||
if (clickType.equals(ClickType.RIGHT)) {
|
||||
@ -328,6 +322,12 @@ public class BlueprintManagementPanel {
|
||||
} else {
|
||||
// Select blueprint
|
||||
if (blueprints.containsKey(slot)) {
|
||||
// Renaming blueprint
|
||||
if (clickType.equals(ClickType.RIGHT)) {
|
||||
u.closeInventory();
|
||||
this.askForBlueprintName(u.getPlayer(), addon, blueprint, bb);
|
||||
return true;
|
||||
}
|
||||
if (selected != null && slot == selected.getKey()){
|
||||
// Clicked on same item - deselect
|
||||
selected = null;
|
||||
|
Loading…
Reference in New Issue
Block a user