From da3a175986383c7258997653f2dc6ec6cf3be961 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 30 Jun 2017 17:05:47 -0400 Subject: [PATCH] Fix mod in new 1.12 versions --- src/main/java/com/tterrag/blur/Blur.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/tterrag/blur/Blur.java b/src/main/java/com/tterrag/blur/Blur.java index 281f8a2..d07c02a 100644 --- a/src/main/java/com/tterrag/blur/Blur.java +++ b/src/main/java/com/tterrag/blur/Blur.java @@ -60,19 +60,21 @@ public class Blur { private ShaderResourcePack dummyPack = new ShaderResourcePack(); @SuppressWarnings("unchecked") + public Blur() { + ((List)ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "field_110449_ao", "defaultResourcePacks")).add(dummyPack); + } + @EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); // Add our dummy resourcepack - ((List)ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "field_110449_ao", "defaultResourcePacks")).add(dummyPack); ((SimpleReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(dummyPack); config = new Configuration(new File(event.getModConfigurationDirectory(), "blur.cfg")); saveConfig(); } - @SuppressWarnings("null") private void saveConfig() { blurExclusions = config.getStringList("guiExclusions", Configuration.CATEGORY_GENERAL, new String[] { @@ -110,7 +112,6 @@ public void onConfigChanged(OnConfigChangedEvent event) { } } - @SuppressWarnings("null") @SubscribeEvent public void onGuiChange(GuiOpenEvent event) { if (_listShaders == null) { @@ -132,7 +133,6 @@ private float getProgress() { return Math.min((System.currentTimeMillis() - start) / (float) fadeTime, 1); } - @SuppressWarnings("null") @SubscribeEvent public void onRenderTick(RenderTickEvent event) { if (event.phase == Phase.END && Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().entityRenderer.isShaderActive()) {