FullBright Module
This commit is contained in:
@@ -29,6 +29,8 @@ public class Config {
|
||||
public int coordsP = 4;
|
||||
public boolean coordsEnabled = true;
|
||||
|
||||
public boolean fullbrightEnabled = false;
|
||||
|
||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||
private static final Path PATH = FabricLoader.getInstance().getConfigDir().resolve("citrus-dev.json");
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package de.fullrisk.citrusDev.UI;
|
||||
|
||||
import de.fullrisk.citrusDev.Config;
|
||||
|
||||
public class Module_Fullbright {
|
||||
|
||||
private static final Config CONFIG = Config.get();
|
||||
|
||||
static boolean toggle = CONFIG.fullbrightEnabled;
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return toggle;
|
||||
}
|
||||
|
||||
public static void setEnabled(boolean value) {
|
||||
toggle = value;
|
||||
CONFIG.fullbrightEnabled = value;
|
||||
CONFIG.save();
|
||||
}
|
||||
}
|
||||
@@ -310,11 +310,32 @@ public class MyScreen extends BaseOwoScreen<FlowLayout> {
|
||||
openModuleSettings("Coords", CoordsSettings());
|
||||
},
|
||||
"Module Enabled", "Keystrokes is now active",
|
||||
"Module Disabled", "KeyStrokes is now inactive"
|
||||
"Module Disabled", "Keystrokes is now inactive"
|
||||
);
|
||||
|
||||
FlowLayout fullbrightRow = ModuleRow.build(
|
||||
GLASS_PANEL, DISABLED, FLAT,
|
||||
Identifier.fromNamespaceAndPath("citrus-dev", "textures/icons/block_culling_file.png"),
|
||||
18, 12,
|
||||
MC_FIVE,
|
||||
"Fullbright",
|
||||
"Max brightness in dark areas",
|
||||
new ModuleRow.ToggleState() {
|
||||
public boolean get() { return Module_Fullbright.isEnabled(); }
|
||||
public void set(boolean value) { Module_Fullbright.setEnabled(value); }
|
||||
},
|
||||
Identifier.fromNamespaceAndPath("citrus-dev", "textures/icons/settings.png"),
|
||||
() -> {
|
||||
Config.get().lastModule = "Fullbright";
|
||||
Config.get().save();
|
||||
},
|
||||
"Module Enabled", "Fullbright is now active",
|
||||
"Module Disabled", "Fullbright is now inactive"
|
||||
);
|
||||
content.child(coordinatesRow);
|
||||
content.child(keyStrokesRow);
|
||||
content.child(fpsRow);
|
||||
content.child(fullbrightRow);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class CitrusDevClient implements ClientModInitializer {
|
||||
|
||||
public static final String API_URL = "http://localhost:3008";
|
||||
public static final String API_URL = "https://citrus-api.winniepat.de";
|
||||
|
||||
private static KeyMapping openScreenKey;
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package de.fullrisk.citrusDev.mixin;
|
||||
|
||||
import de.fullrisk.citrusDev.UI.Module_Fullbright;
|
||||
import net.minecraft.client.renderer.LightmapRenderStateExtractor;
|
||||
import net.minecraft.client.renderer.state.LightmapRenderState;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(LightmapRenderStateExtractor.class)
|
||||
public class LightmapRenderStateExtractorMixin {
|
||||
|
||||
@Inject(method = "extract", at = @At("RETURN"))
|
||||
private void citrusDev$fullbright(LightmapRenderState renderState, float partialTicks, CallbackInfo ci) {
|
||||
if (Module_Fullbright.isEnabled()) {
|
||||
renderState.brightness = 15.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user