Skip to content

Commit

Permalink
launches in dev env!
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Aug 7, 2024
1 parent 1edb1e7 commit adf912a
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ repositories {
// Configures the libraries/dependencies for your mod.
dependencies {
// Adds the OneConfig library, so we can develop with it.
val oneconfig = "1.0.0-alpha.19"
val oneconfig = "1.0.0-alpha.21"
implementation("org.polyfrost.oneconfig:config-impl:$oneconfig")
implementation("org.polyfrost.oneconfig:commands:$oneconfig")
implementation("org.polyfrost.oneconfig:events:$oneconfig")
implementation("org.polyfrost.oneconfig:ui:$oneconfig")
implementation("org.polyfrost.oneconfig:internal:$oneconfig")
modImplementation("org.polyfrost.oneconfig:$platform:$oneconfig")

modShade("org.polyfrost:elementa-$platform:561") {
modShade("org.polyfrost:elementa-$platform:562") {
isTransitive = false
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/club/sk1er/patcher/Patcher.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package club.sk1er.patcher;

import org.polyfrost.oneconfig.api.ui.v1.Notifications;
import org.polyfrost.oneconfig.api.ui.v1.NotificationsManager;
import org.polyfrost.polyui.notify.Notifications;
import org.polyfrost.oneconfig.utils.v1.JsonUtils;
import org.polyfrost.polyui.unit.Units;
import org.polyfrost.universal.UDesktop;
Expand Down Expand Up @@ -163,7 +164,7 @@ public void onPostInit(FMLPostInitializationEvent event) {
@EventHandler
public void onLoadComplete(FMLLoadCompleteEvent event) {
List<ModContainer> activeModList = Loader.instance().getActiveModList();
Notifications notifications = Notifications.INSTANCE;
NotificationsManager notifications = NotificationsManager.INSTANCE;
this.detectIncompatibilities(activeModList, notifications);
this.detectReplacements(activeModList, notifications);

Expand Down Expand Up @@ -341,7 +342,7 @@ private void fixSettings() {
this.forceSaveConfig();
}

private void detectIncompatibilities(List<ModContainer> activeModList, Notifications notifications) {
private void detectIncompatibilities(List<ModContainer> activeModList, NotificationsManager notifications) {
for (ModContainer container : activeModList) {
String modId = container.getModId();
String baseMessage = container.getName() + " has been detected. ";
Expand Down Expand Up @@ -381,7 +382,7 @@ private void detectIncompatibilities(List<ModContainer> activeModList, Notificat
this.forceSaveConfig();
}

private void detectReplacements(List<ModContainer> activeModList, Notifications notifications) {
private void detectReplacements(List<ModContainer> activeModList, NotificationsManager notifications) {
Multithreading.submit(() -> {
JsonObject replacedMods;
try { // todo: replaced an async thing but i think its fine because get() pauses the game thread anyways i think???
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/club/sk1er/patcher/config/PatcherConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,12 @@ public static int getInventoryScale() {
)
public static boolean shadowedNametagText = false;
public static float riddenHorseOpacity = 1F;
@Switch(
title = "Number Ping",
description = "Show a readable ping number in tab instead of bars.",
category = "Deprecated", subcategory = "Tab"
)
public static boolean numberPing;
@Switch(
title = "Clean View",
description = "Stop rendering your potion effect particles.",
Expand Down Expand Up @@ -1802,7 +1808,7 @@ public static int getInventoryScale() {
public static boolean chatPosition = false;


@Include public static boolean labyModMoment = true;
public static boolean labyModMoment = true;
@Include public static String selectedAudioDevice = "";

public static PatcherConfig INSTANCE = new PatcherConfig(); // Needs to be at the bottom or the default values take priority
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package club.sk1er.patcher.util.chat;

import org.polyfrost.oneconfig.api.ui.v1.Notifications;
import org.polyfrost.oneconfig.api.ui.v1.NotificationsManager;
import org.polyfrost.polyui.notify.Notifications;
import org.polyfrost.universal.ChatColor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.polyfrost.oneconfig.api.ui.v1.Notifications;
import org.polyfrost.oneconfig.api.ui.v1.NotificationsManager;
import org.polyfrost.polyui.notify.Notifications;
import org.polyfrost.polyui.unit.Units;

import java.io.File;
Expand Down Expand Up @@ -209,10 +210,10 @@ private String getHash(File modFile) {
public void resetCache() {
if (cacheFile.exists()) {
if (cacheFile.delete()) {
Notifications.INSTANCE.enqueue(Notifications.Type.Info, "PolyPatcher", "Deleted entrypoint cache", Units.seconds(5));
NotificationsManager.INSTANCE.enqueue(Notifications.Type.Info, "PolyPatcher", "Deleted entrypoint cache", Units.seconds(5));
logger.info("Deleted entrypoint cache");
} else {
Notifications.INSTANCE.enqueue(Notifications.Type.Error, "PolyPatcher", "Failed to delete entrypoint cache!", Units.seconds(5));
NotificationsManager.INSTANCE.enqueue(Notifications.Type.Error, "PolyPatcher", "Failed to delete entrypoint cache!", Units.seconds(5));
logger.error("Failed to delete entrypoint cache");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import club.sk1er.patcher.config.PatcherConfig;
import club.sk1er.patcher.mixins.accessors.RenderManagerAccessor;
import club.sk1er.patcher.util.chat.ChatUtilities;
import org.polyfrost.oneconfig.api.ui.v1.Notifications;
import org.polyfrost.oneconfig.api.ui.v1.NotificationsManager;
import org.polyfrost.polyui.notify.Notifications;
import org.polyfrost.universal.UDesktop;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
Expand Down Expand Up @@ -150,7 +151,7 @@ private static int getQuery() {
PatcherConfig.entityCulling = false;
Patcher.instance.forceSaveConfig();

Notifications.INSTANCE.enqueue(
NotificationsManager.INSTANCE.enqueue(
Notifications.Type.Error,
"Patcher",
"Entity Culling has been disabled as your computer is too old and does not support the technology behind it.\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import net.minecraft.client.gui.GuiScreenOptionsSounds;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.polyfrost.oneconfig.api.ui.v1.Notifications;
import org.polyfrost.oneconfig.api.ui.v1.NotificationsManager;
import org.polyfrost.polyui.notify.Notifications;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -67,7 +68,7 @@ public void initGui(GuiScreenEvent.InitGuiEvent.Post event) {
try {
this.mc.getSoundHandler().onResourceManagerReload(this.mc.getResourceManager());
} catch (Exception e) {
Notifications.INSTANCE.enqueue(Notifications.Type.Error, "Patcher", "Failed to reinitialize OpenAL.");
NotificationsManager.INSTANCE.enqueue(Notifications.Type.Error, "Patcher", "Failed to reinitialize OpenAL.");
Patcher.instance.getLogger().error("Failed to reinitialize OpenAL.", e);
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/mixins.patcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,8 @@
"performance.network.packet.S3FPacketCustomPayloadMixin_MemoryLeak",
"performance.optifine.MathHelperMixin_OFFastMath",
"performance.render.item.ItemStackMixin_CacheDisplayName"
],
"mixins": [
"bugfixes.MavenUpdateChecker_Lol"
]
}

0 comments on commit adf912a

Please sign in to comment.