Fix non-functional reset button
This commit is contained in:
parent
bf2d5c83d9
commit
b6d5c0c502
1 changed files with 4 additions and 3 deletions
|
@ -4,6 +4,7 @@ import dev.zontreck.libzontreck.chat.ChatColor;
|
||||||
import dev.zontreck.libzontreck.chestgui.ChestGUI;
|
import dev.zontreck.libzontreck.chestgui.ChestGUI;
|
||||||
import dev.zontreck.libzontreck.chestgui.ChestGUIButton;
|
import dev.zontreck.libzontreck.chestgui.ChestGUIButton;
|
||||||
import dev.zontreck.libzontreck.chestgui.ChestGUIIdentifier;
|
import dev.zontreck.libzontreck.chestgui.ChestGUIIdentifier;
|
||||||
|
import dev.zontreck.libzontreck.items.ModItems;
|
||||||
import dev.zontreck.libzontreck.lore.LoreEntry;
|
import dev.zontreck.libzontreck.lore.LoreEntry;
|
||||||
import dev.zontreck.libzontreck.util.ServerUtilities;
|
import dev.zontreck.libzontreck.util.ServerUtilities;
|
||||||
import dev.zontreck.libzontreck.vectors.Vector2i;
|
import dev.zontreck.libzontreck.vectors.Vector2i;
|
||||||
|
@ -104,16 +105,16 @@ public class ClientConfigResponse
|
||||||
.withInfo(new LoreEntry.Builder().text(ChatColor.doColors("!Dark_Green!Status: " + (enableHealth ? "!Dark_Green!Enabled" : "!Dark_Red!Disabled"))).build())
|
.withInfo(new LoreEntry.Builder().text(ChatColor.doColors("!Dark_Green!Status: " + (enableHealth ? "!Dark_Green!Enabled" : "!Dark_Red!Disabled"))).build())
|
||||||
);
|
);
|
||||||
|
|
||||||
prompt.withReset(()->{
|
prompt.withButton(new ChestGUIButton(ModItems.CHESTGUI_RESET.get(), "Reset", ()->{
|
||||||
ModMessages.sendToPlayer(new S2CResetConfig(), ServerUtilities.getPlayerByID(id.toString()));
|
ModMessages.sendToPlayer(new S2CResetConfig(), ServerUtilities.getPlayerByID(id.toString()));
|
||||||
|
|
||||||
prompt.close();
|
prompt.close();
|
||||||
|
|
||||||
ModMessages.sendToPlayer(new RequestClientConfig(), player);
|
ModMessages.sendToPlayer(new RequestClientConfig(), player);
|
||||||
});
|
|
||||||
|
|
||||||
|
}, new Vector2i(2,4)));
|
||||||
|
|
||||||
prompt.updateUtilityButtons();
|
prompt.hasReset=false;
|
||||||
prompt.open();
|
prompt.open();
|
||||||
}catch(Exception e)
|
}catch(Exception e)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue