diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d42e34b5..7b185c653 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,11 @@ name: Java CI - Build Release on: - release: - types: [ published ] + push: + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+' + - 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+' + - 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+\.[0-9]+' jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e93e33c9..099b43c20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# [2101.1.1] + +### Added +* The pinned quests panel now has a "Pinned Quests" title for clarity +* Added a feedback option for command reward + * In the case where running a command produces no obvious effect, this can help notify the player that something has happened + +### Changed +* Overhauled and cleaned up many icon textures + +### Fixed +* Fixed context menu tooltips sometimes appearing behind the context menu +* Fixed some issues with the reward table editor GUI (changes not getting correctly sync'd to server in some cases) + # [2101.1.0] ### Changed diff --git a/build.gradle b/build.gradle index 39317fff7..f52fc6b48 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,8 @@ plugins { id "me.modmuss50.mod-publish-plugin" version "0.5.1" } +apply from: 'https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/changelog.gradle' + architectury { minecraft = rootProject.minecraft_version } @@ -13,6 +15,13 @@ subprojects { loom { silentMojangMappingsLicense() + + runs { + client { + vmArgs "-Xmx4G" + programArgs "--width", "1920", "--height", "1080" + } + } } dependencies { @@ -95,7 +104,7 @@ allprojects { publishMods { dryRun = providers.environmentVariable("CURSEFORGE_KEY").getOrNull() == null - changelog = providers.environmentVariable("CHANGELOG").getOrElse("No changelog provided") + changelog = createChangelog(project) version = "${mod_version}" // TODO: Migrate to something else diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/block/entity/LootCrateOpenerBlockEntity.java b/common/src/main/java/dev/ftb/mods/ftbquests/block/entity/LootCrateOpenerBlockEntity.java index c2ef947bf..b01d380dd 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/block/entity/LootCrateOpenerBlockEntity.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/block/entity/LootCrateOpenerBlockEntity.java @@ -126,7 +126,7 @@ protected ItemStack _insertItem(int slot, ItemStack stack, boolean simulate) { return stack; } - LootCrate crate = LootCrateItem.getCrate(stack); + LootCrate crate = LootCrateItem.getCrate(stack, false); if (crate == null) { return stack; } @@ -160,7 +160,7 @@ protected ItemStack _insertItem(int slot, ItemStack stack, boolean simulate) { } protected boolean _isItemValid(int slot, ItemStack stack) { - return slot == 0 && LootCrateItem.getCrate(stack) != null; + return slot == 0 && LootCrateItem.getCrate(stack, level.isClientSide) != null; } protected ItemStack _extractItem(int slot, int amount, boolean simulate) { diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsClientEventHandler.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsClientEventHandler.java index 3948d4b1b..4b17d8dd4 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsClientEventHandler.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsClientEventHandler.java @@ -58,290 +58,295 @@ import static dev.ftb.mods.ftbquests.client.TaskScreenRenderer.*; public class FTBQuestsClientEventHandler { - private static final ResourceLocation QUESTS_BUTTON = FTBQuestsAPI.rl("quests"); - - static boolean creativeTabRebuildPending = false; - - private List observationTasks = null; - private ObservationTask currentlyObserving = null; - private long currentlyObservingTicks = 0L; - private final List pinnedQuestText = new ArrayList<>(); - - public static TextureAtlasSprite inputOnlySprite; - public static TextureAtlasSprite tankSprite; - public static TextureAtlasSprite feEnergyEmptySprite; - public static TextureAtlasSprite feEnergyFullSprite; - public static TextureAtlasSprite trEnergyEmptySprite; - public static TextureAtlasSprite trEnergyFullSprite; - - public void init() { - ClientLifecycleEvent.CLIENT_SETUP.register(this::registerItemColors); - ClientLifecycleEvent.CLIENT_SETUP.register(this::registerBERs); - SidebarButtonCreatedEvent.EVENT.register(this::onSidebarButtonCreated); - ClearFileCacheEvent.EVENT.register(this::onFileCacheClear); - ClientTickEvent.CLIENT_PRE.register(this::onKeyEvent); - CustomClickEvent.EVENT.register(this::onCustomClick); - ClientTickEvent.CLIENT_PRE.register(this::onClientTick); - ClientGuiEvent.RENDER_HUD.register(this::onScreenRender); - ClientPlayerEvent.CLIENT_PLAYER_JOIN.register(this::onPlayerLogin); - ClientPlayerEvent.CLIENT_PLAYER_QUIT.register(this::onPlayerLogout); - } - - // Note: Architectury doesn't have a texture stitch post event anymore, - // so this is handled by the Forge/NeoForge events, and a mixin on Fabric - public static void onTextureStitchPost(TextureAtlas textureAtlas) { - if (textureAtlas.location().equals(InventoryMenu.BLOCK_ATLAS)) { - inputOnlySprite = textureAtlas.getSprite(INPUT_ONLY_TEXTURE); - tankSprite = textureAtlas.getSprite(TANK_TEXTURE); - feEnergyEmptySprite = textureAtlas.getSprite(FE_ENERGY_EMPTY_TEXTURE); - feEnergyFullSprite = textureAtlas.getSprite(FE_ENERGY_FULL_TEXTURE); - trEnergyEmptySprite = textureAtlas.getSprite(TR_ENERGY_EMPTY_TEXTURE); - trEnergyFullSprite = textureAtlas.getSprite(TR_ENERGY_FULL_TEXTURE); - } - } - - private void registerBERs(Minecraft minecraft) { - BlockEntityRendererRegistry.register(ModBlockEntityTypes.CORE_TASK_SCREEN.get(), taskScreenRenderer()); - } - - @ExpectPlatform - public static BlockEntityRendererProvider taskScreenRenderer() { - throw new AssertionError(); - } - - private void registerItemColors(Minecraft minecraft) { - ColorHandlerRegistry.registerItemColors((stack, tintIndex) -> { - LootCrate crate = LootCrateItem.getCrate(stack); - return crate == null ? 0xFFFFFFFF : (0xFF000000 | crate.getColor().rgb()); - }, ModItems.LOOTCRATE.get()); - } - - private void onSidebarButtonCreated(SidebarButtonCreatedEvent event) { - if (event.getButton().getId().equals(QUESTS_BUTTON)) { - event.getButton().addOverlayRender(ButtonOverlayRender.ofSimpleString(() -> - { - if (ClientQuestFile.exists()) { - if (ClientQuestFile.INSTANCE.isDisableGui() && !ClientQuestFile.INSTANCE.canEdit()) { - return "[X]"; - } else if (ClientQuestFile.INSTANCE.selfTeamData.isLocked()) { - return "[X]"; - } else if (ClientQuestFile.INSTANCE.selfTeamData.hasUnclaimedRewards(Minecraft.getInstance().player.getUUID(), ClientQuestFile.INSTANCE)) { - return "[!]"; - } - } - - return ""; - })); - } - } - - private void onFileCacheClear(BaseQuestFile file) { - if (!file.isServerSide()) { - observationTasks = null; - } - } - - private void onKeyEvent(Minecraft mc) { - if (ClientQuestFile.exists() - && (!ClientQuestFile.INSTANCE.isDisableGui() || ClientQuestFile.INSTANCE.canEdit()) - && FTBQuestsClient.KEY_QUESTS.consumeClick()) - { - ClientQuestFile.openGui(); - } - } - - private EventResult onCustomClick(CustomClickEvent event) { - if (event.id().getNamespace().equals(FTBQuestsAPI.MOD_ID) && "open_gui".equals(event.id().getPath())) { - // to be safe, we close the current screen before opening Quests, to avoid potential gui open-close loops with other mods - // also save the cursor position and restore it after, since closing the screen will reset to the centre - double mx = Minecraft.getInstance().mouseHandler.xpos(); - double my = Minecraft.getInstance().mouseHandler.ypos(); - Minecraft.getInstance().setScreen(null); - if (ClientQuestFile.openGui() != null) { - InputConstants.grabOrReleaseMouse(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_CURSOR_NORMAL, mx, my); - } - return EventResult.interruptFalse(); - } - - return EventResult.pass(); - } - - private void onClientTick(Minecraft mc) { - if (mc.level != null && ClientQuestFile.exists() && mc.player != null) { - collectPinnedQuests(ClientQuestFile.INSTANCE); - - if (observationTasks == null) { - observationTasks = ClientQuestFile.INSTANCE.collect(ObservationTask.class); - } - - if (observationTasks.isEmpty()) { - return; - } - - currentlyObserving = null; - - TeamData selfTeamData = ClientQuestFile.INSTANCE.selfTeamData; - if (mc.hitResult != null && mc.hitResult.getType() != HitResult.Type.MISS) { - for (ObservationTask task : observationTasks) { - if (!selfTeamData.isCompleted(task) && task.observe(mc.player, mc.hitResult) - && selfTeamData.canStartTasks(task.getQuest())) { - currentlyObserving = task; - break; - } - } - } - - if (currentlyObserving != null) { - if (!mc.isPaused()) { - currentlyObservingTicks++; - } - - if (currentlyObservingTicks >= currentlyObserving.getTimer()) { - NetworkManager.sendToServer(new SubmitTaskMessage(currentlyObserving.id)); - selfTeamData.addProgress(currentlyObserving, 1L); - currentlyObserving = null; - currentlyObservingTicks = 0L; - } - } else { - currentlyObservingTicks = 0L; - } - } - } - - private void onPlayerLogin(LocalPlayer localPlayer) { - if (creativeTabRebuildPending) { - FTBQuestsClient.rebuildCreativeTabs(); - creativeTabRebuildPending = false; - } - - String locale = FTBQuestsClientConfig.EDITING_LOCALE.get(); - if (!locale.isEmpty() && !locale.equals(Minecraft.getInstance().options.languageCode)) { - NetworkManager.sendToServer(new RequestTranslationTableMessage(locale)); - } - } - - private void onPlayerLogout(@Nullable LocalPlayer localPlayer) { - StructureTask.syncKnownStructureList(List.of()); - } - - private void collectPinnedQuests(ClientQuestFile file) { - TeamData data = file.selfTeamData; - - List pinnedQuests = new ArrayList<>(); - LongSet pinnedIds = data.getPinnedQuestIds(FTBQuestsClient.getClientPlayer()); - if (!pinnedIds.isEmpty()) { - if (pinnedIds.contains(TeamData.AUTO_PIN_ID)) { - // special auto-pin value: collect all quests which can be done now - file.forAllQuests(quest -> { - if (!data.isCompleted(quest) && data.canStartTasks(quest)) { - pinnedQuests.add(quest); - } - }); - } else { - pinnedIds.longStream() - .mapToObj(file::getQuest) - .filter(Objects::nonNull) - .forEach(pinnedQuests::add); - } - } - - Minecraft mc = Minecraft.getInstance(); - - pinnedQuestText.clear(); - - for (int i = 0; i < pinnedQuests.size(); i++) { - Quest quest = pinnedQuests.get(i); - - if (i > 0) pinnedQuestText.add(FormattedCharSequence.EMPTY); // separator line between quests - - pinnedQuestText.addAll(mc.font.split(FormattedText.composite( - mc.font.getSplitter().headByWidth(quest.getTitle(), 160, Style.EMPTY.withBold(true)), - Component.literal(" ") - .withStyle(ChatFormatting.DARK_AQUA) - .append(data.getRelativeProgress(quest) + "%") - ), 500)); - - for (Task task : quest.getTasks()) { - if (!data.isCompleted(task)) { - pinnedQuestText.addAll(mc.font.split(FormattedText.composite( - mc.font.getSplitter().headByWidth(task.getMutableTitle().withStyle(ChatFormatting.GRAY), 160, Style.EMPTY.applyFormat(ChatFormatting.GRAY)), - Component.literal(" ") - .withStyle(ChatFormatting.GREEN) - .append(task.formatProgress(data, data.getProgress(task))) - .append("/") - .append(task.formatMaxProgress()) - ), 500)); - } - } - } - - } - - private void onScreenRender(GuiGraphics graphics, DeltaTracker tickDelta) { - if (!ClientQuestFile.exists()) { - return; - } - - if (currentlyObserving != null) { - renderCurrentlyObserving(Minecraft.getInstance(), graphics, tickDelta); - } - - if (!pinnedQuestText.isEmpty()) { - renderPinnedQuestPanel(Minecraft.getInstance(), graphics); - } - } - - private void renderCurrentlyObserving(Minecraft mc, GuiGraphics graphics, DeltaTracker tickDelta) { - int cx = mc.getWindow().getGuiScaledWidth() / 2; - int cy = mc.getWindow().getGuiScaledHeight() / 2; - - MutableComponent txt = currentlyObserving.getMutableTitle().withStyle(ChatFormatting.YELLOW, ChatFormatting.UNDERLINE); - int txtWidth = mc.font.width(txt); - int boxWidth = Math.max(txtWidth, 100); - - Color4I.DARK_GRAY.withAlpha(130).draw(graphics, cx - boxWidth / 2 - 3, cy - 63, boxWidth + 6, 29); - GuiHelper.drawHollowRect(graphics, cx - boxWidth / 2 - 3, cy - 63, boxWidth + 6, 29, Color4I.DARK_GRAY, false); - - graphics.drawString(mc.font, txt, cx - txtWidth / 2, cy - 60, 0xFFFFFF); - double completed = (currentlyObservingTicks + tickDelta.getGameTimeDeltaPartialTick(false)) / (double) currentlyObserving.getTimer(); - - GuiHelper.drawHollowRect(graphics, cx - boxWidth / 2, cy - 49, boxWidth, 12, Color4I.DARK_GRAY, false); - Color4I.LIGHT_BLUE.withAlpha(130).draw(graphics, cx - boxWidth / 2 + 1, cy - 48, (int) ((boxWidth - 2D) * completed), 10); - - String pctTxt = (currentlyObservingTicks * 100L / currentlyObserving.getTimer()) + "%"; - graphics.drawString(mc.font, pctTxt, cx - mc.font.width(pctTxt) / 2, cy - 47, 0xFFFFFF); - } - - private void renderPinnedQuestPanel(Minecraft mc, GuiGraphics graphics) { - int width = 0; - for (FormattedCharSequence s : pinnedQuestText) { - width = Math.max(width, (int) mc.font.getSplitter().stringWidth(s)); - } - width += 8; - int height = mc.font.lineHeight * pinnedQuestText.size() + 8; - - float scale = ThemeProperties.PINNED_QUEST_SIZE.get(ClientQuestFile.INSTANCE).floatValue(); - - int insetX = FTBQuestsClientConfig.PINNED_QUESTS_INSET_X.get(); - int insetY = FTBQuestsClientConfig.PINNED_QUESTS_INSET_Y.get(); - var pos = FTBQuestsClientConfig.PINNED_QUESTS_POS.get().getPanelPos( - mc.getWindow().getGuiScaledWidth(), mc.getWindow().getGuiScaledHeight(), - (int) (width * scale), (int) (height * scale), - insetX, insetY - ); - - graphics.pose().pushPose(); - graphics.pose().translate(pos.x(), pos.y(), 100); - graphics.pose().scale(scale, scale, 1F); - - GuiHelper.drawHollowRect(graphics, 0, 0, width, height, Color4I.BLACK.withAlpha(100), false); - Color4I.BLACK.withAlpha(100).draw(graphics, 0, 0, width, height); - - graphics.pose().translate(4, 4, 0); - for (int i = 0; i < pinnedQuestText.size(); i++) { - graphics.drawString(mc.font, pinnedQuestText.get(i), 0, i * mc.font.lineHeight, 0xFFFFFFFF); - } - - graphics.pose().popPose(); - } + private static final ResourceLocation QUESTS_BUTTON = FTBQuestsAPI.rl("quests"); + + static boolean creativeTabRebuildPending = false; + + private List observationTasks = null; + private ObservationTask currentlyObserving = null; + private long currentlyObservingTicks = 0L; + private final List pinnedQuestText = new ArrayList<>(); + + public static TextureAtlasSprite inputOnlySprite; + public static TextureAtlasSprite tankSprite; + public static TextureAtlasSprite feEnergyEmptySprite; + public static TextureAtlasSprite feEnergyFullSprite; + public static TextureAtlasSprite trEnergyEmptySprite; + public static TextureAtlasSprite trEnergyFullSprite; + + public void init() { + ClientLifecycleEvent.CLIENT_SETUP.register(this::registerItemColors); + ClientLifecycleEvent.CLIENT_SETUP.register(this::registerBERs); + SidebarButtonCreatedEvent.EVENT.register(this::onSidebarButtonCreated); + ClearFileCacheEvent.EVENT.register(this::onFileCacheClear); + ClientTickEvent.CLIENT_PRE.register(this::onKeyEvent); + CustomClickEvent.EVENT.register(this::onCustomClick); + ClientTickEvent.CLIENT_PRE.register(this::onClientTick); + ClientGuiEvent.RENDER_HUD.register(this::onScreenRender); + ClientPlayerEvent.CLIENT_PLAYER_JOIN.register(this::onPlayerLogin); + ClientPlayerEvent.CLIENT_PLAYER_QUIT.register(this::onPlayerLogout); + } + + // Note: Architectury doesn't have a texture stitch post event anymore, + // so this is handled by the Forge/NeoForge events, and a mixin on Fabric + public static void onTextureStitchPost(TextureAtlas textureAtlas) { + if (textureAtlas.location().equals(InventoryMenu.BLOCK_ATLAS)) { + inputOnlySprite = textureAtlas.getSprite(INPUT_ONLY_TEXTURE); + tankSprite = textureAtlas.getSprite(TANK_TEXTURE); + feEnergyEmptySprite = textureAtlas.getSprite(FE_ENERGY_EMPTY_TEXTURE); + feEnergyFullSprite = textureAtlas.getSprite(FE_ENERGY_FULL_TEXTURE); + trEnergyEmptySprite = textureAtlas.getSprite(TR_ENERGY_EMPTY_TEXTURE); + trEnergyFullSprite = textureAtlas.getSprite(TR_ENERGY_FULL_TEXTURE); + } + } + + private void registerBERs(Minecraft minecraft) { + BlockEntityRendererRegistry.register(ModBlockEntityTypes.CORE_TASK_SCREEN.get(), taskScreenRenderer()); + } + + @ExpectPlatform + public static BlockEntityRendererProvider taskScreenRenderer() { + throw new AssertionError(); + } + + private void registerItemColors(Minecraft minecraft) { + ColorHandlerRegistry.registerItemColors((stack, tintIndex) -> { + LootCrate crate = LootCrateItem.getCrate(stack, true); + return crate == null ? 0xFFFFFFFF : (0xFF000000 | crate.getColor().rgb()); + }, ModItems.LOOTCRATE.get()); + } + + private void onSidebarButtonCreated(SidebarButtonCreatedEvent event) { + if (event.getButton().getId().equals(QUESTS_BUTTON)) { + event.getButton().addOverlayRender(ButtonOverlayRender.ofSimpleString(() -> + { + if (ClientQuestFile.exists()) { + if (ClientQuestFile.INSTANCE.isDisableGui() && !ClientQuestFile.INSTANCE.canEdit()) { + return "[X]"; + } else if (ClientQuestFile.INSTANCE.selfTeamData.isLocked()) { + return "[X]"; + } else if (ClientQuestFile.INSTANCE.selfTeamData.hasUnclaimedRewards(Minecraft.getInstance().player.getUUID(), ClientQuestFile.INSTANCE)) { + return "[!]"; + } + } + + return ""; + })); + } + } + + private void onFileCacheClear(BaseQuestFile file) { + if (!file.isServerSide()) { + observationTasks = null; + } + } + + private void onKeyEvent(Minecraft mc) { + if (ClientQuestFile.exists() + && (!ClientQuestFile.INSTANCE.isDisableGui() || ClientQuestFile.INSTANCE.canEdit()) + && FTBQuestsClient.KEY_QUESTS.consumeClick()) { + ClientQuestFile.openGui(); + } + } + + private EventResult onCustomClick(CustomClickEvent event) { + if (event.id().getNamespace().equals(FTBQuestsAPI.MOD_ID) && "open_gui".equals(event.id().getPath())) { + // to be safe, we close the current screen before opening Quests, to avoid potential gui open-close loops with other mods + // also save the cursor position and restore it after, since closing the screen will reset to the centre + double mx = Minecraft.getInstance().mouseHandler.xpos(); + double my = Minecraft.getInstance().mouseHandler.ypos(); + Minecraft.getInstance().setScreen(null); + if (ClientQuestFile.openGui() != null) { + InputConstants.grabOrReleaseMouse(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_CURSOR_NORMAL, mx, my); + } + return EventResult.interruptFalse(); + } + + return EventResult.pass(); + } + + private void onClientTick(Minecraft mc) { + if (mc.level != null && ClientQuestFile.exists() && mc.player != null) { + collectPinnedQuests(ClientQuestFile.INSTANCE); + + if (observationTasks == null) { + observationTasks = ClientQuestFile.INSTANCE.collect(ObservationTask.class); + } + + if (observationTasks.isEmpty()) { + return; + } + + currentlyObserving = null; + + TeamData selfTeamData = ClientQuestFile.INSTANCE.selfTeamData; + if (mc.hitResult != null && mc.hitResult.getType() != HitResult.Type.MISS) { + for (ObservationTask task : observationTasks) { + if (!selfTeamData.isCompleted(task) && task.observe(mc.player, mc.hitResult) + && selfTeamData.canStartTasks(task.getQuest())) { + currentlyObserving = task; + break; + } + } + } + + if (currentlyObserving != null) { + if (!mc.isPaused()) { + currentlyObservingTicks++; + } + + if (currentlyObservingTicks >= currentlyObserving.getTimer()) { + NetworkManager.sendToServer(new SubmitTaskMessage(currentlyObserving.id)); + selfTeamData.addProgress(currentlyObserving, 1L); + currentlyObserving = null; + currentlyObservingTicks = 0L; + } + } else { + currentlyObservingTicks = 0L; + } + } + } + + private void onPlayerLogin(LocalPlayer localPlayer) { + if (creativeTabRebuildPending) { + FTBQuestsClient.rebuildCreativeTabs(); + creativeTabRebuildPending = false; + } + + String locale = FTBQuestsClientConfig.EDITING_LOCALE.get(); + if (!locale.isEmpty() && !locale.equals(Minecraft.getInstance().options.languageCode)) { + NetworkManager.sendToServer(new RequestTranslationTableMessage(locale)); + } + } + + private void onPlayerLogout(@Nullable LocalPlayer localPlayer) { + StructureTask.syncKnownStructureList(List.of()); + } + + private void collectPinnedQuests(ClientQuestFile file) { + TeamData data = file.selfTeamData; + + List pinnedQuests = new ArrayList<>(); + LongSet pinnedIds = data.getPinnedQuestIds(FTBQuestsClient.getClientPlayer()); + if (!pinnedIds.isEmpty()) { + if (pinnedIds.contains(TeamData.AUTO_PIN_ID)) { + // special auto-pin value: collect all quests which can be done now + file.forAllQuests(quest -> { + if (!data.isCompleted(quest) && data.canStartTasks(quest)) { + pinnedQuests.add(quest); + } + }); + } else { + pinnedIds.longStream() + .mapToObj(file::getQuest) + .filter(Objects::nonNull) + .forEach(pinnedQuests::add); + } + } + + Minecraft mc = Minecraft.getInstance(); + + pinnedQuestText.clear(); + + for (int i = 0; i < pinnedQuests.size(); i++) { + Quest quest = pinnedQuests.get(i); + + if (i > 0) pinnedQuestText.add(FormattedCharSequence.EMPTY); // separator line between quests + + pinnedQuestText.addAll(mc.font.split(FormattedText.composite( + mc.font.getSplitter().headByWidth(quest.getTitle(), 160, Style.EMPTY.withBold(true)), + Component.literal(" ") + .withStyle(ChatFormatting.DARK_AQUA) + .append(data.getRelativeProgress(quest) + "%") + ), 500)); + + for (Task task : quest.getTasks()) { + if (!data.isCompleted(task)) { + pinnedQuestText.addAll(mc.font.split(FormattedText.composite( + mc.font.getSplitter().headByWidth(task.getMutableTitle().withStyle(ChatFormatting.GRAY), 160, Style.EMPTY.applyFormat(ChatFormatting.GRAY)), + Component.literal(" ") + .withStyle(ChatFormatting.GREEN) + .append(task.formatProgress(data, data.getProgress(task))) + .append("/") + .append(task.formatMaxProgress()) + ), 500)); + } + } + } + + } + + private void onScreenRender(GuiGraphics graphics, DeltaTracker tickDelta) { + if (!ClientQuestFile.exists()) { + return; + } + + if (currentlyObserving != null) { + renderCurrentlyObserving(Minecraft.getInstance(), graphics, tickDelta); + } + + if (!pinnedQuestText.isEmpty()) { + renderPinnedQuestPanel(Minecraft.getInstance(), graphics); + } + } + + private void renderCurrentlyObserving(Minecraft mc, GuiGraphics graphics, DeltaTracker tickDelta) { + int cx = mc.getWindow().getGuiScaledWidth() / 2; + int cy = mc.getWindow().getGuiScaledHeight() / 2; + + MutableComponent txt = currentlyObserving.getMutableTitle().withStyle(ChatFormatting.YELLOW, ChatFormatting.UNDERLINE); + int txtWidth = mc.font.width(txt); + int boxWidth = Math.max(txtWidth, 100); + + Color4I.DARK_GRAY.withAlpha(130).draw(graphics, cx - boxWidth / 2 - 3, cy - 63, boxWidth + 6, 29); + GuiHelper.drawHollowRect(graphics, cx - boxWidth / 2 - 3, cy - 63, boxWidth + 6, 29, Color4I.DARK_GRAY, false); + + graphics.drawString(mc.font, txt, cx - txtWidth / 2, cy - 60, 0xFFFFFF); + double completed = (currentlyObservingTicks + tickDelta.getGameTimeDeltaPartialTick(false)) / (double) currentlyObserving.getTimer(); + + GuiHelper.drawHollowRect(graphics, cx - boxWidth / 2, cy - 49, boxWidth, 12, Color4I.DARK_GRAY, false); + Color4I.LIGHT_BLUE.withAlpha(130).draw(graphics, cx - boxWidth / 2 + 1, cy - 48, (int) ((boxWidth - 2D) * completed), 10); + + String pctTxt = (currentlyObservingTicks * 100L / currentlyObserving.getTimer()) + "%"; + graphics.drawString(mc.font, pctTxt, cx - mc.font.width(pctTxt) / 2, cy - 47, 0xFFFFFF); + } + + private void renderPinnedQuestPanel(Minecraft mc, GuiGraphics graphics) { + Component title = Component.translatable("ftbquests.ui.pinned_quests"); + + int titleWidth = mc.font.width(title); + int width = titleWidth; + for (FormattedCharSequence s : pinnedQuestText) { + width = Math.max(width, (int) mc.font.getSplitter().stringWidth(s)); + } + width += 8; + int height = mc.font.lineHeight * (pinnedQuestText.size() + 1) + 11; + + float scale = ThemeProperties.PINNED_QUEST_SIZE.get(ClientQuestFile.INSTANCE).floatValue(); + + int insetX = FTBQuestsClientConfig.PINNED_QUESTS_INSET_X.get(); + int insetY = FTBQuestsClientConfig.PINNED_QUESTS_INSET_Y.get(); + var pos = FTBQuestsClientConfig.PINNED_QUESTS_POS.get().getPanelPos( + mc.getWindow().getGuiScaledWidth(), mc.getWindow().getGuiScaledHeight(), + (int) (width * scale), (int) (height * scale), + insetX, insetY + ); + + graphics.pose().pushPose(); + graphics.pose().translate(pos.x(), pos.y(), 100); + graphics.pose().scale(scale, scale, 1F); + + GuiHelper.drawHollowRect(graphics, 0, 0, width, height, Color4I.BLACK.withAlpha(100), false); + Color4I.BLACK.withAlpha(100).draw(graphics, 0, 0, width, height); + Color4I.GRAY.withAlpha(50).draw(graphics, 1, 1, width - 2, mc.font.lineHeight + 4); + Color4I.BLACK.draw(graphics, 0, mc.font.lineHeight + 4, width, 1); + + graphics.pose().translate(4, 4, 0); + graphics.drawString(mc.font, title, (width - titleWidth) / 2, 0, 0xFFFFFF00); + for (int i = 0; i < pinnedQuestText.size(); i++) { + graphics.drawString(mc.font, pinnedQuestText.get(i), 0, 4 + (i + 1) * mc.font.lineHeight, 0xFFFFFFFF); + } + + graphics.pose().popPose(); + } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsNetClient.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsNetClient.java index f6b80165e..d45f1a77a 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsNetClient.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/FTBQuestsNetClient.java @@ -114,11 +114,11 @@ public static void displayCompletionToast(long id) { } } - public static void displayItemRewardToast(ItemStack stack, int count) { + public static void displayItemRewardToast(ItemStack stack, int count, boolean disableBlur) { ItemStack stack1 = ItemStackHooks.copyWithCount(stack, 1); Icon icon = ItemIcon.getItemIcon(stack1); - if (!IRewardListenerScreen.add(new RewardKey(stack.getHoverName().getString(), icon, stack1), count)) { + if (!IRewardListenerScreen.add(new RewardKey(stack.getHoverName().getString(), icon, stack1, disableBlur), count)) { MutableComponent comp = count > 1 ? Component.literal(count + "x ").append(stack.getHoverName()) : stack.getHoverName().copy(); @@ -126,10 +126,10 @@ public static void displayItemRewardToast(ItemStack stack, int count) { } } - public static void displayRewardToast(long id, Component text, Icon icon) { + public static void displayRewardToast(long id, Component text, Icon icon, boolean disableBlur) { Icon i = icon.isEmpty() ? ClientQuestFile.INSTANCE.getBase(id).getIcon() : icon; - if (!IRewardListenerScreen.add(new RewardKey(text.getString(), i), 1)) { + if (!IRewardListenerScreen.add(new RewardKey(text.getString(), i, disableBlur), 1)) { Minecraft.getInstance().getToasts().addToast(new RewardToast(text, i)); } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/ContextMenuBuilder.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/ContextMenuBuilder.java index 7a23fb3b9..a938a54e0 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/ContextMenuBuilder.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/ContextMenuBuilder.java @@ -44,7 +44,7 @@ public ContextMenuBuilder insertAtBottom(Collection toAdd) { } public void openContextMenu(BaseScreen gui) { - gui.openContextMenu(build(gui)); + gui.openContextMenu(build(gui)).setExtraZlevel(900); } public List build(BaseScreen gui) { diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/EditRewardTableScreen.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/EditRewardTableScreen.java index f1b3ed1f1..08cc2952c 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/EditRewardTableScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/EditRewardTableScreen.java @@ -1,5 +1,6 @@ package dev.ftb.mods.ftbquests.client.gui; +import com.mojang.blaze3d.platform.InputConstants; import dev.ftb.mods.ftblibrary.config.ConfigGroup; import dev.ftb.mods.ftblibrary.config.DoubleConfig; import dev.ftb.mods.ftblibrary.config.ui.EditConfigScreen; @@ -100,6 +101,17 @@ protected void doAccept() { parentScreen.run(); } + public boolean keyPressed(Key key) { + if (super.keyPressed(key)) { + return true; + } else if ((key.is(InputConstants.KEY_RETURN) || key.is(InputConstants.KEY_NUMPADENTER)) && key.modifiers.shift()) { + this.doAccept(); + return true; + } else { + return false; + } + } + private class CustomTopPanel extends TopPanel { private final RewardTableSettingsButton settingsButton; private final AddWeightedRewardButton addButton; diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardKey.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardKey.java index cbc2c0abd..02c3530ce 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardKey.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardKey.java @@ -9,15 +9,17 @@ public class RewardKey { private final String title; private final Icon icon; private final ItemStack stack; + private final boolean disableBlur; - public RewardKey(String title, Icon icon) { - this(title, icon, ItemStack.EMPTY); + public RewardKey(String title, Icon icon, boolean disableBlur) { + this(title, icon, ItemStack.EMPTY, disableBlur); } - public RewardKey(String title, Icon icon, ItemStack stack) { + public RewardKey(String title, Icon icon, ItemStack stack, boolean disableBlur) { this.title = title; this.icon = icon; this.stack = stack; + this.disableBlur = disableBlur; } public String getTitle() { @@ -28,6 +30,10 @@ public Icon getIcon() { return icon; } + public boolean disableBlur() { + return disableBlur; + } + public int hashCode() { return stack.isEmpty() ? Objects.hash(title, icon) : ItemStack.hashItemAndComponents(stack); } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardNotificationsScreen.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardNotificationsScreen.java index b60fc3b14..489922dcf 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardNotificationsScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardNotificationsScreen.java @@ -42,6 +42,9 @@ public void addWidgets() { for (RewardKey key : keys) { add(new RewardNotification(this, key)); } + + boolean renderBlur = keys.stream().anyMatch(RewardKey::disableBlur); + RewardNotificationsScreen.this.setRenderBlur(!renderBlur); } @Override diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardTablesScreen.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardTablesScreen.java index 9e2348f86..378196e6e 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardTablesScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/RewardTablesScreen.java @@ -14,6 +14,7 @@ import dev.ftb.mods.ftblibrary.ui.input.MouseButton; import dev.ftb.mods.ftblibrary.ui.misc.AbstractButtonListScreen; import dev.ftb.mods.ftblibrary.util.TooltipList; +import dev.ftb.mods.ftbquests.FTBQuests; import dev.ftb.mods.ftbquests.client.ClientQuestFile; import dev.ftb.mods.ftbquests.client.gui.quests.QuestScreen; import dev.ftb.mods.ftbquests.net.CreateObjectMessage; @@ -25,24 +26,31 @@ import dev.ftb.mods.ftbquests.quest.reward.RandomReward; import dev.ftb.mods.ftbquests.quest.translation.TranslationKey; import dev.ftb.mods.ftbquests.registry.ModItems; +import it.unimi.dsi.fastutil.ints.IntOpenHashSet; +import it.unimi.dsi.fastutil.ints.IntSet; import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.world.item.Items; import org.apache.commons.lang3.mutable.MutableInt; import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.function.Function; import java.util.stream.Collectors; public class RewardTablesScreen extends AbstractButtonListScreen { private final QuestScreen questScreen; private final SimpleTextButton addButton; private final List rewardTablesCopy; // deep local copy of reward tables + private final IntSet editedIndexes = new IntOpenHashSet(); + private final IntSet pendingDeleteIndexes = new IntOpenHashSet(); private boolean changed = false; - private final Set editedTables = new HashSet<>(); public RewardTablesScreen(QuestScreen questScreen) { super(); @@ -79,8 +87,12 @@ public void onClicked(MouseButton button) { @Override public void addButtons(Panel panel) { - rewardTablesCopy.stream().sorted() - .forEach(table -> panel.add(new RewardTableButton(panel, table))); + List buttons = new ArrayList<>(); + for (int i = 0; i < rewardTablesCopy.size(); i++) { + RewardTable table = rewardTablesCopy.get(i); + buttons.add(new RewardTableButton(panel, table, i)); + } + panel.addAll(buttons.stream().sorted(Comparator.comparing(btn -> btn.table)).toList()); } @Override @@ -127,27 +139,46 @@ protected void doCancel() { @Override protected void doAccept() { - ClientQuestFile file = ClientQuestFile.INSTANCE; - Set toRemove = file.getRewardTables().stream().map(t -> t.id).collect(Collectors.toSet()); - - rewardTablesCopy.forEach(table -> { - if (table.getId() == 0L) { - // newly-created - CompoundTag extra = Util.make(new CompoundTag(), tag -> file.getTranslationManager().addInitialTranslation( - tag, file.getLocale(), TranslationKey.TITLE, table.getRawTitle()) - ); - NetworkManager.sendToServer(CreateObjectMessage.create(table, extra)); + IntSet toCreate = new IntOpenHashSet(); + for (int idx = 0; idx < rewardTablesCopy.size(); idx++) { + if (rewardTablesCopy.get(idx).getId() == 0L && !pendingDeleteIndexes.contains(idx)) { + toCreate.add(idx); } - toRemove.remove(table.getId()); - }); + } + editedIndexes.removeAll(pendingDeleteIndexes); - toRemove.forEach(id -> NetworkManager.sendToServer(new DeleteObjectMessage(id))); + int nAdded = sendToServer(toCreate, RewardTablesScreen::makeCreationPacket, true); + int nEdited = sendToServer(editedIndexes, EditObjectMessage::forQuestObject, false); + int nDeleted = sendToServer(pendingDeleteIndexes, DeleteObjectMessage::forQuestObject, false); - editedTables.forEach(table -> NetworkManager.sendToServer(EditObjectMessage.forQuestObject(table))); + FTBQuests.LOGGER.debug("Sent {} new, {} edited, {} deleted reward tables to server", nAdded, nEdited, nDeleted); questScreen.run(); } + private static CreateObjectMessage makeCreationPacket(RewardTable table) { + ClientQuestFile file = ClientQuestFile.INSTANCE; + CompoundTag extra = Util.make(new CompoundTag(), tag -> file.getTranslationManager().addInitialTranslation( + tag, file.getLocale(), TranslationKey.TITLE, table.getRawTitle()) + ); + return CreateObjectMessage.create(table, extra); + } + + private int sendToServer(IntSet indexes, Function func, boolean addNew) { + int sent = 0; + for (int idx : indexes) { + if (idx >= 0 && idx < rewardTablesCopy.size()) { + RewardTable table = rewardTablesCopy.get(idx); + if (addNew && table.id == 0 || !addNew && table.id != 0) { + // id == 0 means table is only locally added, no need to sync an edit/delete for it + NetworkManager.sendToServer(func.apply(table)); + sent++; + } + } + } + return sent; + } + private class CustomTopPanel extends TopPanel { @Override public void addWidgets() { @@ -169,11 +200,13 @@ public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) private class RewardTableButton extends SimpleTextButton { private final RewardTable table; + private final int idx; - public RewardTableButton(Panel panel, RewardTable table) { + public RewardTableButton(Panel panel, RewardTable table, int idx) { super(panel, table.getTitle(), table.getIcon()); this.table = table; + this.idx = idx; setHeight(16); if (this.table.getLootCrate() != null) { @@ -199,7 +232,7 @@ public void onClicked(MouseButton button) { List menu = List.of( new ContextMenuItem(Component.translatable("ftbquests.gui.edit"), ItemIcon.getItemIcon(Items.FEATHER), b -> editRewardTable()), - new ContextMenuItem(Component.translatable("gui.remove"), Icons.BIN, + new ContextMenuItem(Component.translatable(pendingDeleteIndexes.contains(idx) ? "ftbquests.gui.restore" : "gui.remove"), Icons.BIN, b -> deleteRewardTable()), new ContextMenuItem(getLootCrateText(), ItemIcon.getItemIcon(ModItems.LOOTCRATE.get()), b -> toggleLootCrate()) @@ -214,25 +247,43 @@ public void drawBackground(GuiGraphics graphics, Theme theme, int x, int y, int ItemIcon.getItemIcon(ModItems.LOOTCRATE.get()).draw(graphics, x + w - 26, y + 2, 12, 12); Icons.BIN.draw(graphics, x + w - 13, y + 2, 12, 12); } + if (pendingDeleteIndexes.contains(idx)) { + Color4I.RED.withAlpha(64).draw(graphics, x, y, w, h); + } else if (rewardTablesCopy.get(idx).getId() == 0) { + Color4I.GREEN.withAlpha(64).draw(graphics, x, y, w, h); + } Color4I.GRAY.withAlpha(40).draw(graphics, x, y + h, w, 1); } + @Override + public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) { + super.draw(graphics, theme, x, y, w, h); + + if (pendingDeleteIndexes.contains(idx)) { + Color4I.GRAY.draw(graphics, x + 20, y + h / 2, theme.getStringWidth(title), 1); + } else if (rewardTablesCopy.get(idx).getId() == 0) { + Icons.ADD.draw(graphics, x + 24 + theme.getStringWidth(title), y + 2, 12, 12); + } + } + private void editRewardTable() { new EditRewardTableScreen(RewardTablesScreen.this, table, editedReward -> { - rewardTablesCopy.replaceAll(t -> t.getId() == editedReward.id ? editedReward : t); + rewardTablesCopy.set(idx, editedReward); changed = true; - editedTables.add(editedReward); + editedIndexes.add(idx); editedReward.clearCachedData(); refreshWidgets(); }).openGui(); } private void deleteRewardTable() { - openYesNo(Component.translatable("delete_item", table.getTitle()), Component.empty(), () -> { - rewardTablesCopy.removeIf(t -> t == table); - changed = true; - refreshWidgets(); - }); + if (pendingDeleteIndexes.contains(idx)) { + pendingDeleteIndexes.remove(idx); + } else { + pendingDeleteIndexes.add(idx); + } + changed = true; + refreshWidgets(); } private void toggleLootCrate() { @@ -245,6 +296,7 @@ private void toggleLootCrate() { } changed = true; + editedIndexes.add(idx); refreshWidgets(); } @@ -253,7 +305,7 @@ public void addMouseOverText(TooltipList list) { super.addMouseOverText(list); if (getMouseX() > getX() + width - 13) { - list.add(Component.translatable("gui.remove")); + list.add(Component.translatable(pendingDeleteIndexes.contains(idx) ? "ftbquests.gui.restore" : "gui.remove")); } else if (getMouseX() > getX() + width - 26) { list.add(getLootCrateText()); } else { @@ -269,7 +321,7 @@ public void addMouseOverText(TooltipList list) { @NotNull private Component getLootCrateText() { - return Component.translatable("ftbquests.reward_table." + + return Component.translatable("ftbquests.reward_table." + (table.getLootCrate() != null ? "disable_loot_crate" : "enable_loot_crate")); } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterPanel.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterPanel.java index 514c0a3d6..3286331c0 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterPanel.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/ChapterPanel.java @@ -42,7 +42,6 @@ public class ChapterPanel extends Panel { public static final Icon ARROW_COLLAPSED = Icon.getIcon("ftbquests:textures/gui/arrow_collapsed.png"); public static final Icon ARROW_EXPANDED = Icon.getIcon("ftbquests:textures/gui/arrow_expanded.png"); - public static final int Z_LEVEL = 300; private static final Pattern NON_EMPTY_PAT = Pattern.compile("^.+$"); private final QuestScreen questScreen; @@ -140,7 +139,7 @@ public void drawBackground(GuiGraphics graphics, Theme theme, int x, int y, int @Override public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) { graphics.pose().pushPose(); - graphics.pose().translate(0, 0, Z_LEVEL); + graphics.pose().translate(0, 0, QuestScreen.Z_LEVEL); RenderSystem.enableDepthTest(); super.draw(graphics, theme, x, y, w, h); graphics.pose().popPose(); @@ -209,7 +208,7 @@ public void onClicked(MouseButton button) { run(); }, b.getTitle()).atMousePosition(); overlay.setWidth(150); - overlay.setExtraZlevel(Z_LEVEL + 10); + overlay.setExtraZlevel(QuestScreen.Z_LEVEL + 10); getGui().pushModalPanel(overlay); })); @@ -226,7 +225,7 @@ public void onClicked(MouseButton button) { } }, b.getTitle()).atMousePosition(); overlay.setWidth(150); - overlay.setExtraZlevel(Z_LEVEL + 10); + overlay.setExtraZlevel(QuestScreen.Z_LEVEL + 10); getGui().pushModalPanel(overlay); })); @@ -270,7 +269,7 @@ public void addMouseOverText(TooltipList list) { chapterPanel.questScreen.addInfoTooltip(list, chapterPanel.questScreen.file); if (getMouseX() > getX() + width - 18) { - list.string(chapterPanel.isPinned() ? "Stays open" : "Doesn't stay open"); + list.translate(chapterPanel.isPinned() ? "ftbquests.gui.stays_open" : "ftbquests.gui.does_not_stay_open"); } else if (chapterPanel.questScreen.file.canEdit() && getMouseX() > getX() + width - 34) { list.translate("gui.add"); } @@ -311,7 +310,7 @@ public void onClicked(MouseButton button) { run(); }, Component.translatable("ftbquests.chapter")).atMousePosition(); overlay.setWidth(150); - overlay.setExtraZlevel(Z_LEVEL + 10); + overlay.setExtraZlevel(QuestScreen.Z_LEVEL + 10); getGui().pushModalPanel(overlay); return; diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/OtherButtonsPanelBottom.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/OtherButtonsPanelBottom.java index bb344429f..e154f9175 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/OtherButtonsPanelBottom.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/OtherButtonsPanelBottom.java @@ -18,6 +18,7 @@ import dev.ftb.mods.ftbquests.quest.task.StructureTask; import dev.ftb.mods.ftbquests.quest.theme.ThemeLoader; import dev.ftb.mods.ftbquests.quest.theme.property.ThemeProperties; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.network.chat.ClickEvent; import net.minecraft.network.chat.Component; @@ -118,8 +119,8 @@ public void onClicked(MouseButton button) { b -> ChangeProgressMessage.sendToServer(questScreen.file.selfTeamData, questScreen.file, progressChange -> progressChange.setReset(false))) .setYesNoText(Component.translatable("ftbquests.gui.complete_instantly_q"))); - contextMenu.add(new ContextMenuItem(Component.translatable("ftbquests.reward_tables"), ThemeProperties.REWARD_TABLE_ICON.get(), - b -> new RewardTablesScreen(questScreen).openGui())); + contextMenu.add(new TooltipContextMenuItem(Component.translatable("ftbquests.reward_tables"), ThemeProperties.REWARD_TABLE_ICON.get(), + b -> new RewardTablesScreen(questScreen).openGui(), Component.literal("[Ctrl + T]").withStyle(ChatFormatting.DARK_GRAY))); contextMenu.add(new ContextMenuItem(Component.translatable("ftbquests.gui.save_on_server"), ThemeProperties.SAVE_ICON.get(), b -> NetworkManager.sendToServer(ForceSaveMessage.INSTANCE))); contextMenu.add(new ContextMenuItem(Component.translatable("ftbquests.gui.save_as_file"), ThemeProperties.DOWNLOAD_ICON.get(), diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestButton.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestButton.java index 3c7af8542..aeec77e8d 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestButton.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestButton.java @@ -402,7 +402,7 @@ public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) if (!questIcon.isEmpty()) { int s = (int) (w / 8F * 3F); poseStack.pushPose(); - poseStack.translate(x + w - s, y, 0); + poseStack.translate(x + w - s, y, QuestScreen.Z_LEVEL); questIcon.draw(graphics, 0, 0, s, s); poseStack.popPose(); } @@ -410,7 +410,7 @@ public void draw(GuiGraphics graphics, Theme theme, int x, int y, int w, int h) if (!hiddenIcon.isEmpty()) { int s = (int) (w / 8F * 3F); poseStack.pushPose(); - poseStack.translate(x, y, 0); + poseStack.translate(x, y, QuestScreen.Z_LEVEL); hiddenIcon.draw(graphics, 0, 0, s, s); poseStack.popPose(); } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestPanel.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestPanel.java index 18cdc0206..a1401e4cd 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestPanel.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestPanel.java @@ -507,7 +507,7 @@ public boolean mousePressed(MouseButton button) { }); } - questScreen.openContextMenu(contextMenu); + questScreen.openContextMenu(contextMenu).setExtraZlevel(900); return true; } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestScreen.java b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestScreen.java index 2a63c7ba9..a6ff6e763 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/client/gui/quests/QuestScreen.java @@ -18,6 +18,7 @@ import dev.ftb.mods.ftbquests.client.FTBQuestsClient; import dev.ftb.mods.ftbquests.client.gui.CustomToast; import dev.ftb.mods.ftbquests.client.gui.FTBQuestsTheme; +import dev.ftb.mods.ftbquests.client.gui.RewardTablesScreen; import dev.ftb.mods.ftbquests.client.gui.SelectQuestObjectScreen; import dev.ftb.mods.ftbquests.net.*; import dev.ftb.mods.ftbquests.quest.*; @@ -42,6 +43,11 @@ import java.util.*; public class QuestScreen extends BaseScreen { + // A fairly large z-offset is needed to ensure various GUI elements render above drawn block items, + // which can extend quite some way out of the screen if the quest button is scaled up... + // Note: can't be larger than this, apparently, or tooltips end up underneath + public static final int Z_LEVEL = 900; + final ClientQuestFile file; double scrollWidth, scrollHeight; @@ -107,6 +113,11 @@ public boolean doesGuiPauseGame() { return ClientQuestFile.INSTANCE.isPauseGame(); } + @Override + public int getMaxZLevel() { + return Z_LEVEL + 100; + } + @Override public void addWidgets() { QuestTheme.currentObject = selectedChapter; @@ -257,11 +268,11 @@ public void addObjectMenuItems(List contextMenu, Runnable gui, }; if (selectedChapter != null) { if (selectedChapter.isAutofocus(object.id)) { - contextMenu.add(new ContextMenuItem(Component.translatable("ftbquest.gui.clear_autofocused"), + contextMenu.add(new ContextMenuItem(Component.translatable("ftbquests.gui.clear_autofocused"), Icons.MARKER, b -> setAutofocusedId(0L))); } else if (object instanceof Quest || object instanceof QuestLink) { - contextMenu.add(new ContextMenuItem(Component.translatable("ftbquest.gui.set_autofocused"), + contextMenu.add(new ContextMenuItem(Component.translatable("ftbquests.gui.set_autofocused"), Icons.MARKER, b -> setAutofocusedId(object.id))); } @@ -529,6 +540,12 @@ public boolean keyPressed(Key key) { return pasteSelectedQuest(!key.modifiers.shift()); } } + case GLFW.GLFW_KEY_T -> { + if (key.modifiers.control()) { + new RewardTablesScreen(this).openGui(); + return true; + } + } } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/item/LootCrateItem.java b/common/src/main/java/dev/ftb/mods/ftbquests/item/LootCrateItem.java index 0b42e0934..aa0d237df 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/item/LootCrateItem.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/item/LootCrateItem.java @@ -1,5 +1,6 @@ package dev.ftb.mods.ftbquests.item; +import dev.architectury.platform.Platform; import dev.ftb.mods.ftbquests.FTBQuests; import dev.ftb.mods.ftbquests.client.ClientQuestFile; import dev.ftb.mods.ftbquests.client.gui.RewardNotificationsScreen; @@ -42,16 +43,21 @@ public LootCrateItem() { } @Nullable - public static LootCrate getCrate(ItemStack stack) { + public static LootCrate getCrate(ItemStack stack, boolean isClientSide) { return FTBQuests.getComponent(stack, ModDataComponents.LOOT_CRATE) - .map(type -> LootCrate.LOOT_CRATES.get(type)) + .map(type -> LootCrate.getLootCrates(isClientSide).get(type)) .orElse(null); } + @Nullable + public static LootCrate getCrate(ItemStack stack) { + return getCrate(stack, Platform.getEnv() == EnvType.CLIENT); + } + @Override public InteractionResultHolder use(Level world, Player player, InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); - LootCrate crate = getCrate(stack); + LootCrate crate = getCrate(stack, player.level().isClientSide); if (crate == null) { return new InteractionResultHolder<>(InteractionResult.FAIL, stack); @@ -87,7 +93,7 @@ public InteractionResultHolder use(Level world, Player player, Intera @Override public boolean isFoil(ItemStack stack) { - LootCrate crate = getCrate(stack); + LootCrate crate = getCrate(stack, true); return crate != null && crate.isGlow(); } @@ -104,7 +110,7 @@ public void appendHoverText(ItemStack stack, TooltipContext context, List type() { return TYPE; diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayItemRewardToastMessage.java b/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayItemRewardToastMessage.java index fc91eb197..488436ea7 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayItemRewardToastMessage.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayItemRewardToastMessage.java @@ -9,12 +9,13 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.world.item.ItemStack; -public record DisplayItemRewardToastMessage(ItemStack stack, int count) implements CustomPacketPayload { +public record DisplayItemRewardToastMessage(ItemStack stack, int count, boolean disableBlur) implements CustomPacketPayload { public static final Type TYPE = new Type<>(FTBQuestsAPI.rl("display_item_reward_toast_message")); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ItemStack.OPTIONAL_STREAM_CODEC, DisplayItemRewardToastMessage::stack, ByteBufCodecs.VAR_INT, DisplayItemRewardToastMessage::count, + ByteBufCodecs.BOOL, DisplayItemRewardToastMessage::disableBlur, DisplayItemRewardToastMessage::new ); @@ -24,6 +25,6 @@ public Type type() { } public static void handle(DisplayItemRewardToastMessage message, NetworkManager.PacketContext context) { - context.queue(() -> FTBQuestsNetClient.displayItemRewardToast(message.stack, message.count)); + context.queue(() -> FTBQuestsNetClient.displayItemRewardToast(message.stack, message.count, message.disableBlur)); } } \ No newline at end of file diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayRewardToastMessage.java b/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayRewardToastMessage.java index a310a243a..e0d7cdbcb 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayRewardToastMessage.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/net/DisplayRewardToastMessage.java @@ -11,13 +11,14 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -public record DisplayRewardToastMessage(long id, Component text, Icon icon) implements CustomPacketPayload { +public record DisplayRewardToastMessage(long id, Component text, Icon icon, boolean disableBlur) implements CustomPacketPayload { public static final Type TYPE = new Type<>(FTBQuestsAPI.rl("display_reward_toast_message")); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.VAR_LONG, DisplayRewardToastMessage::id, ComponentSerialization.STREAM_CODEC, DisplayRewardToastMessage::text, Icon.STREAM_CODEC, DisplayRewardToastMessage::icon, + ByteBufCodecs.BOOL, DisplayRewardToastMessage::disableBlur, DisplayRewardToastMessage::new ); @@ -27,6 +28,6 @@ public Type type() { } public static void handle(DisplayRewardToastMessage message, NetworkManager.PacketContext context) { - context.queue(() -> FTBQuestsNetClient.displayRewardToast(message.id, message.text, message.icon)); + context.queue(() -> FTBQuestsNetClient.displayRewardToast(message.id, message.text, message.icon, message.disableBlur)); } } \ No newline at end of file diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/net/SyncTranslationMessageToClient.java b/common/src/main/java/dev/ftb/mods/ftbquests/net/SyncTranslationMessageToClient.java index afbe3f55d..0babb84ca 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/net/SyncTranslationMessageToClient.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/net/SyncTranslationMessageToClient.java @@ -7,7 +7,6 @@ import dev.ftb.mods.ftbquests.client.ClientQuestFile; import dev.ftb.mods.ftbquests.quest.QuestObjectBase; import dev.ftb.mods.ftbquests.quest.translation.TranslationKey; -import dev.ftb.mods.ftbquests.util.NetUtils; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; @@ -52,7 +51,7 @@ public Type type() { public static void handle(SyncTranslationMessageToClient message, NetworkManager.PacketContext context) { context.queue(() -> { ClientQuestFile file = ClientQuestFile.INSTANCE; - if (file.isValid() && NetUtils.canEdit(context)) { + if (file.isValid()) { QuestObjectBase object = file.getBase(message.id); if (object != null) { message.val.ifLeft(str -> file.getTranslationManager().addTranslation(object, message.locale, message.subKey, str)) diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/BaseQuestFile.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/BaseQuestFile.java index a9765c848..eb1f04790 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/BaseQuestFile.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/BaseQuestFile.java @@ -791,22 +791,23 @@ private void handleLegacyTaskNBT(Task task, CompoundTag taskNBT) { } public void updateLootCrates() { - Set prevCrateNames = new HashSet<>(LootCrate.LOOT_CRATES.keySet()); - Collection oldStacks = LootCrate.allCrateStacks(); + Map lootCrates = LootCrate.getLootCrates(!isServerSide()); + Set prevCrateNames = new HashSet<>(lootCrates.keySet()); + Collection oldStacks = LootCrate.allCrateStacks(!isServerSide()); - LootCrate.LOOT_CRATES.clear(); + lootCrates.clear(); for (RewardTable table : rewardTables) { if (table.getLootCrate() != null) { - LootCrate.LOOT_CRATES.put(table.getLootCrate().getStringID(), table.getLootCrate()); + lootCrates.put(table.getLootCrate().getStringID(), table.getLootCrate()); } } - if (!isServerSide() && !prevCrateNames.equals(LootCrate.LOOT_CRATES.keySet())) { + if (!isServerSide() && !prevCrateNames.equals(lootCrates.keySet())) { FTBQuestsClient.rebuildCreativeTabs(); - FTBQuests.getRecipeModHelper().updateItemsDynamic(oldStacks, LootCrate.allCrateStacks()); + FTBQuests.getRecipeModHelper().updateItemsDynamic(oldStacks, LootCrate.allCrateStacks(!isServerSide())); } - FTBQuests.LOGGER.debug("Updated loot crates (was {}, now {})", prevCrateNames.size(), LootCrate.LOOT_CRATES.size()); + FTBQuests.LOGGER.debug("Updated loot crates (was {}, now {})", prevCrateNames.size(), lootCrates.size()); } public void markDirty() { diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/loot/LootCrate.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/loot/LootCrate.java index 67ace2a54..6a380f07b 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/loot/LootCrate.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/loot/LootCrate.java @@ -20,14 +20,15 @@ public final class LootCrate { private static final Pattern NON_ALPHANUM = Pattern.compile("[^a-z0-9_]"); private static final Pattern MULTI_UNDERSCORE = Pattern.compile("_{2,}"); - public static Map LOOT_CRATES = new LinkedHashMap<>(); + private static final Map LOOT_CRATES_CLIENT = new LinkedHashMap<>(); + private static final Map LOOT_CRATES_SERVER = new LinkedHashMap<>(); private final RewardTable table; private String stringID; private String itemName = ""; private Color4I color = Color4I.WHITE; private boolean glow = false; - private EntityWeight drops = new EntityWeight(); + private final EntityWeight drops = new EntityWeight(); public LootCrate(RewardTable table, boolean initFromTable) { this.table = table; @@ -39,6 +40,10 @@ public LootCrate(RewardTable table, boolean initFromTable) { } } + public static Map getLootCrates(boolean isClient) { + return isClient ? LOOT_CRATES_CLIENT : LOOT_CRATES_SERVER; + } + public void initFromTable() { stringID = buildStringID(table); Defaults def = Defaults.NAME_MAP.getNullable(stringID); @@ -142,8 +147,8 @@ public ItemStack createStack() { return stack; } - public static Collection allCrateStacks() { - return LOOT_CRATES.values().stream().map(LootCrate::createStack).toList(); + public static Collection allCrateStacks(boolean isClientSide) { + return getLootCrates(isClientSide).values().stream().map(LootCrate::createStack).toList(); } private enum Defaults { diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/CommandReward.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/CommandReward.java index e9db2f621..ce9406cd2 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/CommandReward.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/CommandReward.java @@ -1,6 +1,10 @@ package dev.ftb.mods.ftbquests.quest.reward; +import dev.architectury.networking.NetworkManager; import dev.ftb.mods.ftblibrary.config.ConfigGroup; +import dev.ftb.mods.ftblibrary.icon.Color4I; +import dev.ftb.mods.ftblibrary.icon.Icon; +import dev.ftb.mods.ftbquests.net.DisplayRewardToastMessage; import dev.ftb.mods.ftbquests.quest.Quest; import dev.ftb.mods.ftbteams.api.FTBTeamsAPI; import net.fabricmc.api.EnvType; @@ -24,15 +28,18 @@ public class CommandReward extends Reward { private static final String DEFAULT_COMMAND = "/say Hi, @p!"; + private static final Icon REWARD_ICON = Icon.getIcon("minecraft:block/command_block_back"); public static final Pattern PATTERN = Pattern.compile("[{](\\w+)}"); private String command; private boolean elevatePerms; private boolean silent; + private String feedbackMessage; public CommandReward(long id, Quest quest) { super(id, quest); command = DEFAULT_COMMAND; + feedbackMessage = ""; } @Override @@ -48,6 +55,7 @@ public void writeData(CompoundTag nbt, HolderLookup.Provider provider) { nbt.putBoolean("elevate_perms", true); } if (silent) nbt.putBoolean("silent", true); + nbt.putString("feedback_message", feedbackMessage); } @Override @@ -56,6 +64,7 @@ public void readData(CompoundTag nbt, HolderLookup.Provider provider) { command = nbt.getString("command"); elevatePerms = nbt.getBoolean("elevate_perms"); silent = nbt.getBoolean("silent"); + feedbackMessage = nbt.getString("feedback_message"); } @Override @@ -64,6 +73,7 @@ public void writeNetData(RegistryFriendlyByteBuf buffer) { buffer.writeUtf(command, Short.MAX_VALUE); buffer.writeBoolean(elevatePerms); buffer.writeBoolean(silent); + buffer.writeUtf(feedbackMessage, Short.MAX_VALUE); } @Override @@ -72,6 +82,7 @@ public void readNetData(RegistryFriendlyByteBuf buffer) { command = buffer.readUtf(Short.MAX_VALUE); elevatePerms = buffer.readBoolean(); silent = buffer.readBoolean(); + feedbackMessage = buffer.readUtf(Short.MAX_VALUE); } @Override @@ -81,6 +92,7 @@ public void fillConfigGroup(ConfigGroup config) { config.addString("command", command, v -> command = v, DEFAULT_COMMAND).setNameKey("ftbquests.reward.ftbquests.command"); config.addBool("elevate", elevatePerms, v -> elevatePerms = v, false); config.addBool("silent", silent, v -> silent = v, false); + config.addString("feedback_message", feedbackMessage, v -> feedbackMessage = v, ""); } @Override @@ -113,6 +125,11 @@ public void claim(ServerPlayer player, boolean notify) { if (silent) source = source.withSuppressedOutput(); player.server.getCommands().performPrefixedCommand(source, cmd); + + if (notify) { + String key = feedbackMessage.isEmpty() ? "ftbquests.reward.ftbquests.command.success" : feedbackMessage; + NetworkManager.sendToPlayer(player, new DisplayRewardToastMessage(id, Component.translatable(key), REWARD_ICON, disableRewardScreenBlur)); + } } @Override diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/ItemReward.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/ItemReward.java index 660c45638..f0e100905 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/ItemReward.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/ItemReward.java @@ -142,7 +142,7 @@ public void claim(ServerPlayer player, boolean notify) { } if (notify) { - NetworkManager.sendToPlayer(player, new DisplayItemRewardToastMessage(item, size)); + NetworkManager.sendToPlayer(player, new DisplayItemRewardToastMessage(item, size, disableRewardScreenBlur)); } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/Reward.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/Reward.java index 11a697cf1..1ea7d1ba7 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/Reward.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/Reward.java @@ -38,6 +38,7 @@ public abstract class Reward extends QuestObjectBase { protected RewardAutoClaim autoclaim; private boolean excludeFromClaimAll; private boolean ignoreRewardBlocking; + protected boolean disableRewardScreenBlur; public Reward(long id, Quest q) { super(id); @@ -47,6 +48,7 @@ public Reward(long id, Quest q) { autoclaim = RewardAutoClaim.DEFAULT; excludeFromClaimAll = getType().getExcludeFromListRewards(); ignoreRewardBlocking = false; + disableRewardScreenBlur = false; } public Quest getQuest() { @@ -90,6 +92,7 @@ public void writeData(CompoundTag nbt, HolderLookup.Provider provider) { if (excludeFromClaimAll) nbt.putBoolean("exclude_from_claim_all", true); if (ignoreRewardBlocking) nbt.putBoolean("ignore_reward_blocking", true); + if (disableRewardScreenBlur) nbt.putBoolean("disable_reward_screen_blur", true); } @Override @@ -99,6 +102,7 @@ public void readData(CompoundTag nbt, HolderLookup.Provider provider) { autoclaim = RewardAutoClaim.NAME_MAP.get(nbt.getString("auto")); excludeFromClaimAll = nbt.getBoolean("exclude_from_claim_all"); ignoreRewardBlocking = nbt.getBoolean("ignore_reward_blocking"); + disableRewardScreenBlur = nbt.getBoolean("disable_reward_screen_blur"); } @Override @@ -108,6 +112,7 @@ public void writeNetData(RegistryFriendlyByteBuf buffer) { RewardAutoClaim.NAME_MAP.write(buffer, autoclaim); buffer.writeBoolean(excludeFromClaimAll); buffer.writeBoolean(ignoreRewardBlocking); + buffer.writeBoolean(disableRewardScreenBlur); } @Override @@ -117,6 +122,7 @@ public void readNetData(RegistryFriendlyByteBuf buffer) { autoclaim = RewardAutoClaim.NAME_MAP.read(buffer); excludeFromClaimAll = buffer.readBoolean(); ignoreRewardBlocking = buffer.readBoolean(); + disableRewardScreenBlur = buffer.readBoolean(); } @Override @@ -133,6 +139,8 @@ public void fillConfigGroup(ConfigGroup config) { config.addBool("ignore_reward_blocking", ignoreRewardBlocking(), v -> ignoreRewardBlocking = v, ignoreRewardBlocking) .setNameKey("ftbquests.quest.misc.ignore_reward_blocking") .setCanEdit(!isIgnoreRewardBlockingHardcoded()); + config.addBool("disable_reward_screen_blur", disableRewardScreenBlur, v -> disableRewardScreenBlur = v, false) + .setNameKey("ftbquests.reward.disable_reward_screen_blur"); } public abstract void claim(ServerPlayer player, boolean notify); diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPLevelsReward.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPLevelsReward.java index 4325fb51c..b3110fdbc 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPLevelsReward.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPLevelsReward.java @@ -70,7 +70,7 @@ public void claim(ServerPlayer player, boolean notify) { if (notify) { Component text = Component.translatable("ftbquests.reward.ftbquests.xp_levels").append(": ") .append(Component.literal("+" + xpLevels).withStyle(ChatFormatting.GREEN)); - NetworkManager.sendToPlayer(player, new DisplayRewardToastMessage(id, text, Color4I.empty())); + NetworkManager.sendToPlayer(player, new DisplayRewardToastMessage(id, text, Color4I.empty(), disableRewardScreenBlur)); } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPReward.java b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPReward.java index e08d6038e..f05b2c95e 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPReward.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/quest/reward/XPReward.java @@ -70,7 +70,7 @@ public void claim(ServerPlayer player, boolean notify) { if (notify) { Component text = Component.translatable("ftbquests.reward.ftbquests.xp").append(": ") .append(Component.literal("+" + xp).withStyle(ChatFormatting.GREEN)); - NetworkManager.sendToPlayer(player, new DisplayRewardToastMessage(id, text, Color4I.empty())); + NetworkManager.sendToPlayer(player, new DisplayRewardToastMessage(id, text, Color4I.empty(), disableRewardScreenBlur)); } } diff --git a/common/src/main/java/dev/ftb/mods/ftbquests/registry/ModItems.java b/common/src/main/java/dev/ftb/mods/ftbquests/registry/ModItems.java index 5565fdcc8..0f596e47d 100644 --- a/common/src/main/java/dev/ftb/mods/ftbquests/registry/ModItems.java +++ b/common/src/main/java/dev/ftb/mods/ftbquests/registry/ModItems.java @@ -8,6 +8,7 @@ import dev.ftb.mods.ftbquests.api.FTBQuestsAPI; import dev.ftb.mods.ftbquests.item.*; import dev.ftb.mods.ftbquests.item.ScreenBlockItem.ScreenSize; +import dev.ftb.mods.ftbquests.quest.loot.LootCrate; import net.minecraft.core.registries.Registries; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; @@ -16,7 +17,6 @@ import java.util.List; import java.util.function.Supplier; -import java.util.stream.Stream; public class ModItems { public static final DeferredRegister ITEMS = DeferredRegister.create(FTBQuestsAPI.MOD_ID, Registries.ITEM); @@ -68,11 +68,14 @@ public static void register() { CreativeTabRegistry.appendStack(FTBLibrary.getCreativeModeTab(), BASE_ITEMS.stream().map(item -> () -> new ItemStack(item.get()))); - Stream> lootCreates = FTBQuests.PROXY.getKnownLootCrates() - .stream() - .map(crate -> crate::createStack); - - CreativeTabRegistry.appendStack(FTBLibrary.getCreativeModeTab(), lootCreates); + CreativeTabRegistry.modify(FTBLibrary.getCreativeModeTab(), (flags, output, canUseGameMasterBlocks) -> { + var stacks = FTBQuests.PROXY.getKnownLootCrates() + .stream() + .map(LootCrate::createStack) + .filter(stack -> !stack.isEmpty()) + .toList(); + output.acceptAllAfter(BASE_ITEMS.getLast().get(), stacks); + }); } public static Item.Properties defaultProps() { diff --git a/common/src/main/resources/assets/ftbquests/ftb_quests_theme.txt b/common/src/main/resources/assets/ftbquests/ftb_quests_theme.txt index 1ebb915de..05f809f4a 100644 --- a/common/src/main/resources/assets/ftbquests/ftb_quests_theme.txt +++ b/common/src/main/resources/assets/ftbquests/ftb_quests_theme.txt @@ -30,8 +30,8 @@ wiki_icon: ftbquests:textures/gui/info.png wiki_url: - pin_icon_on: ftbquests:textures/gui/pin.png; color=#F8BD1C pin_icon_off: ftbquests:textures/gui/pin.png; color=#DBDBDB -editor_icon_on: ftbquests:textures/gui/editor.png; color=#F8BD1C -editor_icon_off: ftbquests:textures/gui/editor.png; color=#DBDBDB +editor_icon_on: ftbquests:textures/gui/editor.png +editor_icon_off: ftbquests:textures/gui/editor_white.png hidden_icon: ftbquests:textures/gui/hidden.png; color=#DBDBDB link_icon: ftbquests:textures/gui/link.png; color=#DBDBDB save_icon: ftbquests:textures/gui/save.png diff --git a/common/src/main/resources/assets/ftbquests/lang/en_us.json b/common/src/main/resources/assets/ftbquests/lang/en_us.json index 4a18e40f8..f878b772f 100644 --- a/common/src/main/resources/assets/ftbquests/lang/en_us.json +++ b/common/src/main/resources/assets/ftbquests/lang/en_us.json @@ -255,6 +255,8 @@ "ftbquests.gui.select_reward_table": "Select Reward Table", "ftbquests.gui.select_reward_type": "Select Reward Type", "ftbquests.gui.reset_progress": "Reset Progress", + "ftbquests.gui.stays_open": "Stays Open", + "ftbquests.gui.does_not_stay_open": "Doesn't Stay Open", "ftbquests.gui.reset_progress_q": "Reset progress for your team?", "ftbquests.gui.complete_instantly": "Complete Instantly", "ftbquests.gui.complete_instantly_q": "Complete this task instantly?", @@ -312,8 +314,9 @@ "ftbquests.gui.confirm_esc": "Discard Unsaved Changes?", "ftbquests.gui.key_reference.player": "General Controls\n-;Zoom out\n+;Zoom in\n0;Reset Zoom\nTab;Next Chapter\nShift + Tab;Previous Chapter\n1 - 9;Go to Chapter\nSpace;Recenter View\nCtrl + F;Search\nF1;While hovering quest, show extended info\nLeft Mouse;View Quest Details\nMouse Wheel;Scroll Up/Down\nShift + Mouse Wheel;Scroll Left/Right\nCtrl + Mouse Wheel;Zoom In/Out", "ftbquests.gui.key_reference.editor": "Editor Mode\nCtrl + Left Mouse;Toggle Selection\nMiddle Mouse;Move Selected Quest(s)\nRight Mouse;Context Menu\nMiddle Mouse: Drag;Select Quests in Drag Box\nCtrl + Middle Mouse: Drag;Toggle Selection in Box\nCtrl + A;Select All\nCtrl + D;Select None\nCtrl + Up/Down/Left/Right;Move Selected Quests\nCtrl + R;Toggle Crosshairs\nCtrl + C;Copy Selected/Hovered Object\nCtrl + V;Paste Selection\nCtrl + Shift + V;Paste Quest (no dependencies)\nCtrl + Alt + V;Paste as Quest Link\n\nQuest View Panel\nT;Edit Quest Title\nS;Edit Quest Subtitle\nD;Edit Quest Description", - "ftbquest.gui.set_autofocused": "Set as Autofocused Quest", - "ftbquest.gui.clear_autofocused": "Clear Autofocused Quest", + "ftbquests.gui.set_autofocused": "Set as Autofocused Quest", + "ftbquests.gui.clear_autofocused": "Clear Autofocused Quest", + "ftbquests.gui.restore": "Restore", "ftbquests.task": "Task", "ftbquests.tasks": "Tasks", "ftbquests.task.completed": "Task completed!", @@ -441,10 +444,13 @@ "ftbquests.reward.ftbquests.xp": "XP", "ftbquests.reward.ftbquests.xp_levels": "XP Levels", "ftbquests.reward.ftbquests.command": "Command", + "ftbquests.reward.ftbquests.command.success": "Successfully claimed command reward", "ftbquests.reward.ftbquests.command.tooltip": "Vanilla substitutions, e.g. @p, are supported\nSpecial substitutions:\n{x} / {y} / {z} - player's current X/Y/Z pos\n{quest} - ID of this quest\n{chapter} - ID of this chapter\n{team} - short name of player's team", "ftbquests.reward.ftbquests.command.elevate": "Run with Elevated Permission", "ftbquests.reward.ftbquests.command.elevate.tooltip": "Run the command as if the player had permission level 2", "ftbquests.reward.ftbquests.command.silent": "Silent", + "ftbquests.reward.ftbquests.command.feedback_message": "Feedback Toast", + "ftbquests.reward.ftbquests.command.feedback_message.tooltip": "Toast message on command success", "ftbquests.reward.ftbquests.advancement": "Advancement", "ftbquests.reward.ftbquests.advancement.criterion": "Criterion", "ftbquests.reward.ftbquests.advancement.criterion.tooltip": "Optional, set if you want only one criterion to be granted", @@ -470,6 +476,7 @@ "ftbquests.reward.ftbquests.npc_mail.items": "Items", "ftbquests.reward.ftbquests.npc_mail.time_past": "Time Past", "ftbquests.reward_table": "Reward Table", + "ftbquests.reward.disable_reward_screen_blur": "Disable Reward Screen Blur", "ftbquests.reward_table.hide_tooltip": "Hide Tooltip", "ftbquests.reward_table.use_title": "Use Title", "ftbquests.reward_table.edit": "Edit Reward Table", @@ -529,6 +536,7 @@ "ftbquests.ui": "User Interface", "ftbquests.ui.old_scroll_wheel": "Old-style Scroll Wheel Behavior", "ftbquests.ui.old_scroll_wheel.tooltip": "When false, scroll wheel scrolls up & down: hold Shift to pan, Ctrl to zoom\nWhen true, scroll wheel only zooms (1.19 and earlier behavior)", + "ftbquests.ui.pinned_quests": "Pinned Quests", "ftbquests.ui.pinned_quests_pos": "Pinned Quests Panel Position", "ftbquests.ui.pinned_quests_inset_x": "Pinned Quests Panel X Inset", "ftbquests.ui.pinned_quests_inset_x.tooltip": "Inset is toward center of screen.\nIgnored if X pos is center.", diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/alert.png b/common/src/main/resources/assets/ftbquests/textures/gui/alert.png index 521155867..69efbca80 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/alert.png and b/common/src/main/resources/assets/ftbquests/textures/gui/alert.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/alert.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/alert.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/alert.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png index dfdf9eac1..5678d0a36 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png and b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_collapsed.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png index 959229110..a2c085fd8 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png and b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_expanded.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png index 337ee741b..3a253ee7a 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png and b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_left.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png index 18b73f6cc..7172650a8 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png and b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/arrow_right.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/burger.png b/common/src/main/resources/assets/ftbquests/textures/gui/burger.png index 7fff6f1ae..568fbb160 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/burger.png and b/common/src/main/resources/assets/ftbquests/textures/gui/burger.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/burger.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/burger.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/burger.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/close.png b/common/src/main/resources/assets/ftbquests/textures/gui/close.png index 1ffdc9691..14b8b03d0 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/close.png and b/common/src/main/resources/assets/ftbquests/textures/gui/close.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/close.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/close.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/close.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png b/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png index 88132634d..ac75b7e07 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png and b/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/collect_rewards.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/editor.png b/common/src/main/resources/assets/ftbquests/textures/gui/editor.png index e8f07cc91..3a007f691 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/editor.png and b/common/src/main/resources/assets/ftbquests/textures/gui/editor.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/editor.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/editor.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/editor.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/editor_white.png b/common/src/main/resources/assets/ftbquests/textures/gui/editor_white.png new file mode 100644 index 000000000..8bf87184b Binary files /dev/null and b/common/src/main/resources/assets/ftbquests/textures/gui/editor_white.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png b/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png index c3cd9326a..b636a940c 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png and b/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/emergency_items.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/guide.png b/common/src/main/resources/assets/ftbquests/textures/gui/guide.png index 149aa5854..3d0de2801 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/guide.png and b/common/src/main/resources/assets/ftbquests/textures/gui/guide.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png b/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png index a2fc33830..07ffedf56 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png and b/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/hidden.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/info.png b/common/src/main/resources/assets/ftbquests/textures/gui/info.png index c2746a4bd..d216f8231 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/info.png and b/common/src/main/resources/assets/ftbquests/textures/gui/info.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/info.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/info.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/info.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/link.png b/common/src/main/resources/assets/ftbquests/textures/gui/link.png index ba1b97e0c..dce870f26 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/link.png and b/common/src/main/resources/assets/ftbquests/textures/gui/link.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/link.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/link.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/link.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/pin.png b/common/src/main/resources/assets/ftbquests/textures/gui/pin.png index c2ab35988..7ca493231 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/pin.png and b/common/src/main/resources/assets/ftbquests/textures/gui/pin.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/pin.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/pin.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/pin.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/save.png b/common/src/main/resources/assets/ftbquests/textures/gui/save.png index f8a5affdf..141006180 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/save.png and b/common/src/main/resources/assets/ftbquests/textures/gui/save.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/save.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/save.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/save.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/search.png b/common/src/main/resources/assets/ftbquests/textures/gui/search.png index b6bbee08a..5ad9e08c5 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/search.png and b/common/src/main/resources/assets/ftbquests/textures/gui/search.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/search.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/search.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/search.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/settings.png b/common/src/main/resources/assets/ftbquests/textures/gui/settings.png index 8f76bf045..b75a6c73f 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/settings.png and b/common/src/main/resources/assets/ftbquests/textures/gui/settings.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/settings.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/settings.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/settings.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/shop.png b/common/src/main/resources/assets/ftbquests/textures/gui/shop.png index a8ea6921c..88e2af77f 100644 Binary files a/common/src/main/resources/assets/ftbquests/textures/gui/shop.png and b/common/src/main/resources/assets/ftbquests/textures/gui/shop.png differ diff --git a/common/src/main/resources/assets/ftbquests/textures/gui/shop.png.mcmeta b/common/src/main/resources/assets/ftbquests/textures/gui/shop.png.mcmeta deleted file mode 100644 index a39ce83c2..000000000 --- a/common/src/main/resources/assets/ftbquests/textures/gui/shop.png.mcmeta +++ /dev/null @@ -1,5 +0,0 @@ -{ - "texture": { - "blur": true - } -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1837b34dd..ba678b321 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,13 +9,13 @@ maven_group=dev.ftb.mods mod_author=FTB Team # Build time -mod_version=2101.1.0 +mod_version=2101.1.1 minecraft_version=1.21.1 # Cross env #forge_version=50.0.9 #forge_loader_version=49 -neoforge_version=21.1.9 +neoforge_version=21.1.69 neoforge_version_range=[21.1.0,) neoforge_loader_version=4 fabric_loader_version=0.15.11 @@ -23,7 +23,7 @@ fabric_api_version=0.100.8+1.21 fabric_api_version_range=>=0.100.1+1.21 architectury_api_version=13.0.6 -ftb_library_version=2101.1.1 +ftb_library_version=2101.1.4 ftb_teams_version=2101.1.0 # Optional deps