mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-17 12:15:10 +01:00
Add config for radius, using a custom resourcepack
This commit is contained in:
@@ -7,12 +7,13 @@ import java.util.List;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.tterrag.blur.util.ShaderResourcePack;
|
||||
|
||||
import static com.tterrag.blur.Blur.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiChat;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.resources.IResourcePack;
|
||||
import net.minecraft.client.shader.Shader;
|
||||
import net.minecraft.client.shader.ShaderGroup;
|
||||
import net.minecraft.client.shader.ShaderUniform;
|
||||
@@ -48,12 +49,16 @@ public class Blur {
|
||||
private long start;
|
||||
private int fadeTime;
|
||||
|
||||
public int radius;
|
||||
private int colorFirst, colorSecond;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
// Add our dummy resourcepack
|
||||
((List<IResourcePack>)ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "field_110449_ao", "defaultResourcePacks")).add(new ShaderResourcePack());
|
||||
|
||||
config = new Configuration(new File(event.getModConfigurationDirectory(), "blur.cfg"));
|
||||
saveConfig();
|
||||
}
|
||||
@@ -66,6 +71,7 @@ public class Blur {
|
||||
|
||||
fadeTime = config.getInt("fadeTime", Configuration.CATEGORY_GENERAL, 200, 0, Integer.MAX_VALUE, "The time it takes for the blur to fade in, in ms.");
|
||||
|
||||
radius = config.getInt("radius", Configuration.CATEGORY_GENERAL, 12, 1, 100, "The radius of the blur effect. This controls how \"strong\" the blur is.");
|
||||
colorFirst = Integer.parseUnsignedInt(
|
||||
config.getString("gradientStartColor", Configuration.CATEGORY_GENERAL, "75000000", "The start color of the background gradient. Given in ARGB hex."),
|
||||
16
|
||||
|
||||
Reference in New Issue
Block a user