Skip to content

Commit

Permalink
Merge pull request #749 from FTBTeam/feature/1.21-sidebar-change
Browse files Browse the repository at this point in the history
[1.21] Update Sidebar Json to new format
  • Loading branch information
desht authored Aug 9, 2024
2 parents 1014998 + 8ceed0a commit ef2d1af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import dev.architectury.networking.NetworkManager;
import dev.architectury.registry.client.rendering.BlockEntityRendererRegistry;
import dev.architectury.registry.client.rendering.ColorHandlerRegistry;
import dev.ftb.mods.ftblibrary.api.sidebar.ButtonOverlayRender;
import dev.ftb.mods.ftblibrary.icon.Color4I;
import dev.ftb.mods.ftblibrary.sidebar.SidebarButtonCreatedEvent;
import dev.ftb.mods.ftblibrary.ui.CustomClickEvent;
Expand Down Expand Up @@ -117,7 +118,7 @@ private void registerItemColors(Minecraft minecraft) {

private void onSidebarButtonCreated(SidebarButtonCreatedEvent event) {
if (event.getButton().getId().equals(QUESTS_BUTTON)) {
event.getButton().setCustomTextHandler(() ->
event.getButton().addOverlayRender(ButtonOverlayRender.ofSimpleString(() ->
{
if (ClientQuestFile.exists()) {
if (ClientQuestFile.INSTANCE.isDisableGui() && !ClientQuestFile.INSTANCE.canEdit()) {
Expand All @@ -130,7 +131,7 @@ private void onSidebarButtonCreated(SidebarButtonCreatedEvent event) {
}

return "";
});
}));
}
}

Expand Down
12 changes: 0 additions & 12 deletions common/src/main/resources/assets/ftbquests/sidebar_buttons.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"icon": "ftbquests:item/book",
"sort_index": 575,
"click": [
"ftbquests:open_gui"
],
"required_server_mods": [
"ftbquests"
]
}

0 comments on commit ef2d1af

Please sign in to comment.