mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Make GroupConfigSubSettingGui unusabled when asked.
This commit is contained in:
parent
ebe3708eca
commit
a4204263e9
1 changed files with 17 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
|
||||||
private final GroupConfigGui parent;
|
private final GroupConfigGui parent;
|
||||||
private final IncludeGroup group;
|
private final IncludeGroup group;
|
||||||
private final PatternPane pane;
|
private final PatternPane pane;
|
||||||
|
private boolean usable = true;
|
||||||
|
|
||||||
public GroupConfigSubSettingGui(
|
public GroupConfigSubSettingGui(
|
||||||
@NotNull GroupConfigGui parent,
|
@NotNull GroupConfigGui parent,
|
||||||
|
|
@ -194,6 +195,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGuiValues() {
|
public void updateGuiValues() {
|
||||||
|
if(!this.usable) return;
|
||||||
// Parent should call updateLocal with this call
|
// Parent should call updateLocal with this call
|
||||||
this.parent.updateValueForGeneric(this.group, true);
|
this.parent.updateValueForGeneric(this.group, true);
|
||||||
|
|
||||||
|
|
@ -201,6 +203,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateLocal() {
|
public void updateLocal() {
|
||||||
|
if(!this.usable) return;
|
||||||
// Prepare material lore
|
// Prepare material lore
|
||||||
List<String> matLore = SelectMaterialContainer.getMaterialLore(this, "group", "include");
|
List<String> matLore = SelectMaterialContainer.getMaterialLore(this, "group", "include");
|
||||||
|
|
||||||
|
|
@ -233,7 +236,20 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cleanAndBeUnusable() {
|
public void cleanAndBeUnusable() {
|
||||||
//TODO
|
this.usable = false;
|
||||||
|
this.pane.bindItem('1', GuiGlobalItems.backgroundItem());
|
||||||
|
this.pane.bindItem('2', GuiGlobalItems.backgroundItem());
|
||||||
|
this.pane.bindItem('D', GuiGlobalItems.backgroundItem());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show(@NotNull HumanEntity player) {
|
||||||
|
if(!this.usable) {
|
||||||
|
this.parent.show(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.show(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue