Skip to content

Commit

Permalink
Remove enabling/disabling the mod from the API
Browse files Browse the repository at this point in the history
  • Loading branch information
AMereBagatelle committed May 16, 2024
1 parent 3cd7029 commit 78b118d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class NuitClient {
private static NuitConfig CONFIG;

public static void init() {
NuitApi.getInstance().setEnabled(config().generalSettings.enable);
SkyboxManager.getInstance().setEnabled(config().generalSettings.enable);
}

public static Logger getLogger() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@ static int getApiVersion() {
return 0;
}

/**
* Gets the state of the Nuit mod.
*
* @return Whether Nuit is enabled.
*/
boolean isEnabled();

/**
* Allows mods to set the state of the Nuit.
*
* @param enabled State of the Nuit.
*/
void setEnabled(boolean enabled);

/**
* Allows mods to add new skyboxes at runtime.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.gson.GsonBuilder;
import com.mojang.blaze3d.platform.InputConstants;
import io.github.amerebagatelle.mods.nuit.NuitClient;
import io.github.amerebagatelle.mods.nuit.SkyboxManager;
import io.github.amerebagatelle.mods.nuit.api.NuitApi;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -83,10 +84,10 @@ public void tick(Minecraft client) {
while (this.toggleNuit.consumeClick()) {
NuitClient.config().generalSettings.enable = !NuitClient.config().generalSettings.enable;
NuitClient.config().save();
NuitApi.getInstance().setEnabled(NuitClient.config().generalSettings.enable);
SkyboxManager.getInstance().setEnabled(NuitClient.config().generalSettings.enable);

assert client.player != null;
if (NuitApi.getInstance().isEnabled()) {
if (SkyboxManager.getInstance().isEnabled()) {
client.player.displayClientMessage(Component.translatable("nuit.message.enabled"), false);
} else {
client.player.displayClientMessage(Component.translatable("nuit.message.disabled"), false);
Expand Down

0 comments on commit 78b118d

Please sign in to comment.