From 8d05e67e43f9fbf641aa677b3b5b25df1bab67a2 Mon Sep 17 00:00:00 2001 From: Emma Waffle Date: Thu, 10 Feb 2022 21:22:02 -0500 Subject: [PATCH] Add new dark vault screen packs, new option for disabling chat buttons, remove dark vault config --- build.gradle | 19 ++---------- .../emcutils/features/ChatChannels.java | 4 +-- .../frydae/emcutils/features/VaultScreen.java | 4 +-- .../dev/frydae/emcutils/utils/Config.java | 2 +- .../textures/gui/container/generic_63.png | Bin 0 -> 11519 bytes .../resourcepacks/dark-ui-vault/pack.mcmeta | 6 ++++ .../resources/resourcepacks/vt-dark-vault.zip | Bin 0 -> 1487 bytes .../textures/gui/container/generic_63.png} | Bin .../resourcepacks/vt-dark-vault/pack.mcmeta | 6 ++++ fabric/build.gradle | 16 ++++++++++- .../fabric/EmpireMinecraftUtilitiesImpl.java | 13 +++++++++ .../emcutils/utils/fabric/ConfigImpl.java | 4 +-- .../emcutils/utils/fabric/FabricConfig.java | 2 +- forge/build.gradle | 14 +++++++++ .../forge/EmpireMinecraftUtilitiesImpl.java | 27 ++++++++++++++++++ .../frydae/emcutils/forge/ForgeConfig.java | 6 ++-- .../emcutils/utils/forge/ConfigImpl.java | 4 +-- gradle.properties | 4 +-- 18 files changed, 97 insertions(+), 34 deletions(-) create mode 100644 common/src/main/resources/resourcepacks/dark-ui-vault/assets/emcutils/textures/gui/container/generic_63.png create mode 100644 common/src/main/resources/resourcepacks/dark-ui-vault/pack.mcmeta create mode 100644 common/src/main/resources/resourcepacks/vt-dark-vault.zip rename common/src/main/resources/{assets/emcutils/textures/gui/container/generic_63_dark.png => resourcepacks/vt-dark-vault/assets/emcutils/textures/gui/container/generic_63.png} (100%) create mode 100644 common/src/main/resources/resourcepacks/vt-dark-vault/pack.mcmeta diff --git a/build.gradle b/build.gradle index e2fbebc..a795836 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id "architectury-plugin" version "3.4.+" id "dev.architectury.loom" version "0.11.0.+" apply false - id "com.modrinth.minotaur" version "1.2.+" + id "com.modrinth.minotaur" version "1.2.+" apply false id "io.github.juuxel.loom-quiltflower" version "1.+" apply false } @@ -13,6 +13,7 @@ subprojects { apply plugin: "dev.architectury.loom" apply from: rootProject.file("setupAuth.gradle") apply plugin: "io.github.juuxel.loom-quiltflower" + apply plugin: "com.modrinth.minotaur" repositories { maven { @@ -55,22 +56,6 @@ allprojects { jar { from "LICENSE" } - //noinspection UnnecessaryQualifiedReference - task modrinth(type: com.modrinth.minotaur.TaskModrinthUpload) { - final String loader = project.name - onlyIf { System.getenv().MODRINTH_TOKEN } - detectLoaders = false - token = System.getenv().MODRINTH_TOKEN - projectId = "QYTT62S0" - versionNumber = mod_version + "+" + loader - versionName = "${rootProject.release_title} (${loader.substring(0, 1).toUpperCase() + loader.substring(1)})" - changelog = rootProject.changeLog - uploadFile = project.file("build/libs/${rootProject.archivesBaseName}-${rootProject.version}.jar") - versionType = "beta" - addGameVersion(mc_version) - addLoader(loader) - } - publishing { repositories { maven { diff --git a/common/src/main/java/dev/frydae/emcutils/features/ChatChannels.java b/common/src/main/java/dev/frydae/emcutils/features/ChatChannels.java index 69fa7cb..2af3181 100644 --- a/common/src/main/java/dev/frydae/emcutils/features/ChatChannels.java +++ b/common/src/main/java/dev/frydae/emcutils/features/ChatChannels.java @@ -28,7 +28,7 @@ public class ChatChannels { private static final TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; public static void handleChatScreenRender(Screen screen, MatrixStack matrices) { - if (Util.isOnEMC) { + if (Util.isOnEMC && Config.chatButtonsEnabled()) { for (ChatChannel channel : ChatChannel.values()) { if (channel == ChatChannel.SUPPORTER && Util.getPlayerGroupId() < 2) break; if (channel == ChatChannel.MODERATOR && Util.getPlayerGroupId() < 5) break; @@ -40,7 +40,7 @@ public static void handleChatScreenRender(Screen screen, MatrixStack matrices) { } public static void handleChatScreenMouseClicked(Screen screen, double mouseX, double mouseY) { - if (Util.isOnEMC) { + if (Util.isOnEMC && Config.chatButtonsEnabled()) { for (ChatChannel channel : ChatChannel.values()) { if (channel == ChatChannel.SUPPORTER && Util.getPlayerGroupId() < 2) break; if (channel == ChatChannel.MODERATOR && Util.getPlayerGroupId() < 5) break; diff --git a/common/src/main/java/dev/frydae/emcutils/features/VaultScreen.java b/common/src/main/java/dev/frydae/emcutils/features/VaultScreen.java index 54b1201..9c07286 100644 --- a/common/src/main/java/dev/frydae/emcutils/features/VaultScreen.java +++ b/common/src/main/java/dev/frydae/emcutils/features/VaultScreen.java @@ -37,9 +37,7 @@ @SuppressWarnings("SpellCheckingInspection") public class VaultScreen extends HandledScreen implements ScreenHandlerProvider { public static final RegistrySupplier> GENERIC_9X7; - private static final Identifier TEXTURE = new Identifier(MODID, Config.darkVaultScreen() ? - "textures/gui/container/generic_63_dark.png" : - "textures/gui/container/generic_63.png"); + private static final Identifier TEXTURE = new Identifier(MODID, "textures/gui/container/generic_63.png"); private final int vaultPage; private final int[] slotOffsets = {8, 26, 44, 62, 80, 98, 116, 134, 152}; private boolean shouldCallClose = true; diff --git a/common/src/main/java/dev/frydae/emcutils/utils/Config.java b/common/src/main/java/dev/frydae/emcutils/utils/Config.java index ce730e9..df52fe6 100644 --- a/common/src/main/java/dev/frydae/emcutils/utils/Config.java +++ b/common/src/main/java/dev/frydae/emcutils/utils/Config.java @@ -10,7 +10,7 @@ @SuppressWarnings("unused") public class Config { @ExpectPlatform - public static boolean darkVaultScreen() { + public static boolean chatButtonsEnabled() { throw new AssertionError("ExpectPlatform didn't apply!"); } diff --git a/common/src/main/resources/resourcepacks/dark-ui-vault/assets/emcutils/textures/gui/container/generic_63.png b/common/src/main/resources/resourcepacks/dark-ui-vault/assets/emcutils/textures/gui/container/generic_63.png new file mode 100644 index 0000000000000000000000000000000000000000..ed5790c82dc32301e70a33111390b8f1d49ac8b0 GIT binary patch literal 11519 zcmeHtcT`j97H=p@QvtyOh=e9Z0|{vm2uP74ReG0@1c;PC3QZ6M1nEVZbOn(n9SbN$ zL{wBjq$yGb1f(j6(q7OR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t^6_8MpI!$dCwQy$gz7G4-b`N#Rf6`e8<_!UROXdOxb_R)-Oi7gR5E+B&dW6jIEUWU@c(qCWlG@OmbxR;@JfyCbipKQPN|&icyDNZBl}YT;MT_G zYBSt>-En8m^vc-E`vLs(F(u?bE2iIP$X5w+5Iw7se`FSOYnR%&2P(zp)I2c$HCI_ppS~2e~BLl;GCI$vm;tfep z1sau^9B*cOVj8pJ^YjVN&<|^UfR3-&C=) z@v*tFvQ1-SV`Nh^Sf0Rnc=vMaa<==GKi$7LKA3a%nt$qN$%~?nmiu?g`RM5F+59QC z^G)N6UF**0|K*xqfA8D`-TP}34linPWez?h)@HiZ%GcnJ;{s-9&Iy+dCT1Sq-YYYE z!H)@>nS_@)i%Q(t!FR`MT?tc{4lfZxkesJ>8({V$tKiCh_sd<~LoZ&)ewM z{QJ5%f?3QozejqN_UC(@Q=+eKuG=v~|9t(O8H~GM@8nT10?S8#Ik0GhKvWJQ1oqb)^sP};aMwf@Jd=|L~+ z&Hr!zUvK~G)#N!$v#)a9=zW~A;{So#`_4^{SJM5g4HS(lcKzD9rr0Zki2;%+KxFE=?iwIp%%v!H+gEf1e_VVimi|!l| zTCkv%&&5P_tHn-@%?nhF?fErUO_?=2CTh~m;57?YKbRCTWo^K;h*`ml76?w8F@5Ib z$twhc=FOTByCxteXy)WqD_KkyPFp>V8|V;5CVOVwnHcCAFnH?-qTpE?wW00VCwj{=!^ zjY2LGAco>96kvufY2*SH6+{|}T13Di4_7)uSYgGClBxo{S=m66>_GSpX!~KHGy?+w D4khUH literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/emcutils/textures/gui/container/generic_63_dark.png b/common/src/main/resources/resourcepacks/vt-dark-vault/assets/emcutils/textures/gui/container/generic_63.png similarity index 100% rename from common/src/main/resources/assets/emcutils/textures/gui/container/generic_63_dark.png rename to common/src/main/resources/resourcepacks/vt-dark-vault/assets/emcutils/textures/gui/container/generic_63.png diff --git a/common/src/main/resources/resourcepacks/vt-dark-vault/pack.mcmeta b/common/src/main/resources/resourcepacks/vt-dark-vault/pack.mcmeta new file mode 100644 index 0000000..9b52c33 --- /dev/null +++ b/common/src/main/resources/resourcepacks/vt-dark-vault/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 8, + "description": "emcutils - Dark vault (Vanilla Tweaks style)" + } +} diff --git a/fabric/build.gradle b/fabric/build.gradle index b870ca7..2a4df88 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -37,7 +37,7 @@ dependencies { exclude group: "net.fabricmc" } - modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}" modApi("dev.architectury:architectury-fabric:${rootProject.architectury_version}") { exclude group: "net.fabricmc.fabric-api" @@ -89,6 +89,20 @@ components.java { } } +//noinspection UnnecessaryQualifiedReference +task modrinth(type: com.modrinth.minotaur.TaskModrinthUpload) { + onlyIf { System.getenv().MODRINTH_TOKEN } + token = System.getenv().MODRINTH_TOKEN + projectId = "QYTT62S0" + versionNumber = mod_version + "+fabric" + versionName = rootProject.release_title + " (Fabric)" + changelog = rootProject.changeLog + uploadFile = remapJar + versionType = "beta" + addGameVersion(mc_version) + addLoader("fabric") +} + publishing { publications { mavenJavaFabric(MavenPublication) { diff --git a/fabric/src/main/java/dev/frydae/emcutils/fabric/EmpireMinecraftUtilitiesImpl.java b/fabric/src/main/java/dev/frydae/emcutils/fabric/EmpireMinecraftUtilitiesImpl.java index e7d4d30..62c9f54 100644 --- a/fabric/src/main/java/dev/frydae/emcutils/fabric/EmpireMinecraftUtilitiesImpl.java +++ b/fabric/src/main/java/dev/frydae/emcutils/fabric/EmpireMinecraftUtilitiesImpl.java @@ -11,9 +11,12 @@ import eu.midnightdust.lib.config.MidnightConfig; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.util.Identifier; import static dev.frydae.emcutils.utils.Util.LOG; import static dev.frydae.emcutils.utils.Util.MODID; +import static net.fabricmc.fabric.api.resource.ResourceManagerHelper.registerBuiltinResourcePack; +import static net.fabricmc.fabric.api.resource.ResourcePackActivationType.NORMAL; public class EmpireMinecraftUtilitiesImpl implements ClientModInitializer { public static final boolean hasVoxelMap = FabricLoader.getInstance().isModLoaded("voxelmap"); @@ -23,6 +26,12 @@ public class EmpireMinecraftUtilitiesImpl implements ClientModInitializer { public void onInitializeClient() { MidnightConfig.init(MODID, FabricConfig.class); + // These don't work in dev for whatever reason, but work in prod + FabricLoader.getInstance().getModContainer(MODID).ifPresent(container -> + registerBuiltinResourcePack(id("dark-ui-vault"), container, NORMAL)); + FabricLoader.getInstance().getModContainer(MODID).ifPresent(container -> + registerBuiltinResourcePack(id("vt-dark-vault"), container, NORMAL)); + Util.runResidenceCollector(); VaultScreen.initStatic(); @@ -43,4 +52,8 @@ public static void onPostJoinEmpireMinecraft() { if (hasVoxelMap || hasXaeroMap) Tasks.runTasks(new GetLocationTask()); if (hasVoxelMap) Tasks.runTasks(new VoxelMapIntegration()); } + + private static Identifier id(String id) { + return new Identifier(MODID, id); + } } diff --git a/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/ConfigImpl.java b/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/ConfigImpl.java index 16f01ed..4b8aec1 100644 --- a/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/ConfigImpl.java +++ b/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/ConfigImpl.java @@ -5,8 +5,8 @@ import dev.frydae.emcutils.utils.Config.TabListSortType; public class ConfigImpl { - public static boolean darkVaultScreen() { - return FabricConfig.darkVaultScreen; + public static boolean chatButtonsEnabled() { + return FabricConfig.chatButtonsEnabled; } public static boolean tabListShowAllServers() { diff --git a/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/FabricConfig.java b/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/FabricConfig.java index 792b737..435fe67 100644 --- a/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/FabricConfig.java +++ b/fabric/src/main/java/dev/frydae/emcutils/utils/fabric/FabricConfig.java @@ -6,7 +6,7 @@ import eu.midnightdust.lib.config.MidnightConfig; public class FabricConfig extends MidnightConfig { - @Entry public static boolean darkVaultScreen = false; + @Entry public static boolean chatButtonsEnabled = true; @Entry public static boolean tabListShowAllServers = true; @Entry public static TabListSortType tabListSortType = TabListSortType.SERVER_ASCENDING; @Entry public static TabListCurrentServerPlacement tabListCurrentServerPlacement = TabListCurrentServerPlacement.TOP; diff --git a/forge/build.gradle b/forge/build.gradle index 5cc25c8..8648faf 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -76,6 +76,20 @@ components.java { } } +//noinspection UnnecessaryQualifiedReference +task modrinth(type: com.modrinth.minotaur.TaskModrinthUpload) { + onlyIf { System.getenv().MODRINTH_TOKEN } + token = System.getenv().MODRINTH_TOKEN + projectId = "QYTT62S0" + versionNumber = mod_version + "+forge" + versionName = rootProject.release_title + " (Forge)" + changelog = rootProject.changeLog + uploadFile = remapJar + versionType = "beta" + addGameVersion(mc_version) + addLoader("forge") +} + publishing { publications { mavenJavaForge(MavenPublication) { diff --git a/forge/src/main/java/dev/frydae/emcutils/forge/EmpireMinecraftUtilitiesImpl.java b/forge/src/main/java/dev/frydae/emcutils/forge/EmpireMinecraftUtilitiesImpl.java index a98d47f..61c4a24 100644 --- a/forge/src/main/java/dev/frydae/emcutils/forge/EmpireMinecraftUtilitiesImpl.java +++ b/forge/src/main/java/dev/frydae/emcutils/forge/EmpireMinecraftUtilitiesImpl.java @@ -16,6 +16,12 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.Paths; + import static dev.frydae.emcutils.utils.Util.LOG; import static dev.frydae.emcutils.utils.Util.MODID; @@ -27,6 +33,8 @@ public EmpireMinecraftUtilitiesImpl() { ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ForgeConfig.SPEC); + movePacks("vt-dark-vault"); + DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> EmpireMinecraftUtilities::initClient); ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> @@ -39,6 +47,25 @@ public static void onPostJoinEmpireMinecraft() { EmpireMinecraftUtilities.onPostJoinEmpireMinecraftCommon(); } + private static void movePacks(String... packs) { + try { + Files.createDirectories(Paths.get("resourcepacks")); + } catch (FileAlreadyExistsException ignored) { + } catch (IOException e) { + LOG.warn("Could not create resource packs folder"); + return; + } + + for (String pack : packs) { + try (InputStream packZip = EmpireMinecraftUtilitiesImpl.class.getResourceAsStream("/resourcepacks/" + pack + ".zip")) { + Files.copy(packZip, Paths.get("resourcepacks/" + pack + ".zip")); // This works in prod but not dev + } catch (FileAlreadyExistsException ignored) { + } catch (IOException | NullPointerException e) { + e.printStackTrace(); + } + } + } + @SubscribeEvent public static void event(FMLClientSetupEvent event) { MenuRegistry.registerScreenFactory(VaultScreen.GENERIC_9X7.get(), VaultScreen::new); diff --git a/forge/src/main/java/dev/frydae/emcutils/forge/ForgeConfig.java b/forge/src/main/java/dev/frydae/emcutils/forge/ForgeConfig.java index d5f5e2f..94545c8 100644 --- a/forge/src/main/java/dev/frydae/emcutils/forge/ForgeConfig.java +++ b/forge/src/main/java/dev/frydae/emcutils/forge/ForgeConfig.java @@ -10,7 +10,7 @@ public class ForgeConfig { public static final ForgeConfigSpec SPEC; - public static BooleanValue darkVaultScreen; + public static BooleanValue chatButtonsEnabled; public static BooleanValue tabListShowAllServers; public static EnumValue tabListSortType; public static EnumValue tabListCurrentServerPlacement; @@ -36,8 +36,8 @@ public class ForgeConfig { .defineEnum("chatAlertSound", ChatAlertSound.LEVEL_UP); builder.pop(); builder.push("misc").comment("Miscellaneous Settings"); - darkVaultScreen = builder.comment("Dark vault screen (requires restart)") - .define("darkVaultScreen", false); + chatButtonsEnabled = builder.comment("Whether chat buttons are enabled") + .define("chatButtonsEnabled", true); dontRunResidenceCollector = builder.comment("Don't run residence collector") .define("dontRunResidenceCollector", false); builder.pop(); diff --git a/forge/src/main/java/dev/frydae/emcutils/utils/forge/ConfigImpl.java b/forge/src/main/java/dev/frydae/emcutils/utils/forge/ConfigImpl.java index e2c34fd..82fee63 100644 --- a/forge/src/main/java/dev/frydae/emcutils/utils/forge/ConfigImpl.java +++ b/forge/src/main/java/dev/frydae/emcutils/utils/forge/ConfigImpl.java @@ -6,8 +6,8 @@ import dev.frydae.emcutils.utils.Config.TabListSortType; public class ConfigImpl { - public static boolean darkVaultScreen() { - return ForgeConfig.darkVaultScreen.get(); + public static boolean chatButtonsEnabled() { + return ForgeConfig.chatButtonsEnabled.get(); } public static boolean tabListShowAllServers() { diff --git a/gradle.properties b/gradle.properties index 499f301..7da79a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ mc_version=1.18.1 mod_version=3.0.0-beta.1 release_title=Change target to 1.18.1 -changeLog=Re-add VoxelMap support on Fabric, new config system on Forge +changeLog=Re-add VoxelMap support on Fabric, new config system on Forge, new dark vault screen packs, new option for disabling chat buttons # https://fabricmc.net/develop yarn_mappings=22 @@ -14,7 +14,7 @@ loader_version=0.13.1 fabric_version=0.46.4+1.18 # https://files.minecraftforge.net/ -forge_version=39.0.66 +forge_version=39.0.75 # https://maven.shedaniel.me/dev/architectury/architectury/ architectury_version=3.6.17