mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2025-01-08 19:47:54 +01:00
Fix active pages with flag preset menu.
This commit is contained in:
parent
14c087c950
commit
9bcb2f265c
@ -198,7 +198,7 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument
|
|||||||
protected void showCustomFlags(GDPermissionUser src, GDClaim claim, String displayGroup) {
|
protected void showCustomFlags(GDPermissionUser src, GDClaim claim, String displayGroup) {
|
||||||
final Player player = src.getOnlinePlayer();
|
final Player player = src.getOnlinePlayer();
|
||||||
final String lastPermissionMenuType = this.lastActivePresetMenuMap.getIfPresent(player.getUniqueId());
|
final String lastPermissionMenuType = this.lastActivePresetMenuMap.getIfPresent(player.getUniqueId());
|
||||||
if (lastPermissionMenuType != null && lastPermissionMenuType.equalsIgnoreCase(displayGroup)) {
|
if (lastPermissionMenuType != null && !lastPermissionMenuType.equalsIgnoreCase(displayGroup.toLowerCase())) {
|
||||||
PaginationUtil.getInstance().resetActivePage(player.getUniqueId());
|
PaginationUtil.getInstance().resetActivePage(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,9 +255,10 @@ protected void showCustomFlags(GDPermissionUser src, GDClaim claim, String displ
|
|||||||
textComponents.add(TextComponent.of(" "));
|
textComponents.add(TextComponent.of(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
String lastActiveMenu = this.lastActivePresetMenuMap.getIfPresent(src.getUniqueId());
|
String lastMenu = this.lastActiveMenuTypeMap.getIfPresent(src.getUniqueId());
|
||||||
if (lastActiveMenu == null) {
|
MenuType lastActiveMenu = MenuType.CLAIM;
|
||||||
lastActiveMenu = "user";
|
if (lastMenu != null) {
|
||||||
|
lastActiveMenu = MenuType.valueOf(lastMenu.toUpperCase());
|
||||||
}
|
}
|
||||||
Component footer = null;
|
Component footer = null;
|
||||||
if (player.hasPermission(GDPermissions.ADVANCED_FLAGS)) {
|
if (player.hasPermission(GDPermissions.ADVANCED_FLAGS)) {
|
||||||
@ -266,7 +267,7 @@ protected void showCustomFlags(GDPermissionUser src, GDClaim claim, String displ
|
|||||||
.append(" ")
|
.append(" ")
|
||||||
.append(TextComponent.builder()
|
.append(TextComponent.builder()
|
||||||
.append(TextComponent.of("ADVANCED").color(TextColor.GRAY)
|
.append(TextComponent.of("ADVANCED").color(TextColor.GRAY)
|
||||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimFlagConsumer(src, claim, MenuType.CLAIM)))))
|
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createClaimFlagConsumer(src, claim, lastActiveMenu)))))
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
@ -468,13 +469,15 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
|
|||||||
textList.add(TextComponent.of(" "));
|
textList.add(TextComponent.of(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
final String lastActiveMenu = this.lastActivePresetMenuMap.getIfPresent(src.getUniqueId());
|
String lastActivePresetMenu = this.lastActivePresetMenuMap.getIfPresent(src.getUniqueId());
|
||||||
|
if (lastActivePresetMenu == null) {
|
||||||
|
lastActivePresetMenu = "user";
|
||||||
|
}
|
||||||
Component footer = null;
|
Component footer = null;
|
||||||
if (player.hasPermission(GDPermissions.ADVANCED_FLAGS)) {
|
if (player.hasPermission(GDPermissions.ADVANCED_FLAGS)) {
|
||||||
footer = TextComponent.builder().append(TextComponent.builder()
|
footer = TextComponent.builder().append(TextComponent.builder()
|
||||||
.append(TextComponent.of("PRESET").color(TextColor.GRAY)
|
.append(TextComponent.of("PRESET").color(TextColor.GRAY)
|
||||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createCustomFlagConsumer(src, claim, lastActiveMenu)))))
|
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createCustomFlagConsumer(src, claim, lastActivePresetMenu)))))
|
||||||
.build())
|
.build())
|
||||||
.append(" ")
|
.append(" ")
|
||||||
.append(whiteOpenBracket)
|
.append(whiteOpenBracket)
|
||||||
|
Loading…
Reference in New Issue
Block a user