This repository has been archived by the owner on May 11, 2023. It is now read-only.
generated from LabyMod/addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix enable/disable switchsetting got applied imminently
- Loading branch information
Showing
6 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
core/src/main/java/com/github/l3nnartt/fullbright/core/FullBrightSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.github.l3nnartt.fullbright.core; | ||
|
||
public interface FullBrightSettings { | ||
|
||
void setGamma(float gamma); | ||
} |
22 changes: 22 additions & 0 deletions
22
core/src/main/java/com/github/l3nnartt/fullbright/core/listener/ConfigUpdateListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.github.l3nnartt.fullbright.core.listener; | ||
|
||
import com.github.l3nnartt.fullbright.core.FullBrightSettings; | ||
import net.labymod.api.event.Subscribe; | ||
import net.labymod.api.event.labymod.config.SettingUpdateEvent; | ||
import net.labymod.api.inject.LabyGuice; | ||
|
||
public class ConfigUpdateListener { | ||
|
||
FullBrightSettings fullBrightSettings = LabyGuice.getInstance(FullBrightSettings.class); | ||
|
||
@Subscribe | ||
public void onSettingUpdate(SettingUpdateEvent event) { | ||
if (event.setting().getId().equals("enabled")) { | ||
if (!(boolean) event.getValue()) { | ||
fullBrightSettings.setGamma(1.0f); | ||
} else { | ||
fullBrightSettings.setGamma(10.0f); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters