Skip to content

Commit

Permalink
Fix mod in new 1.12 versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tterrag1098 committed Jun 30, 2017
1 parent 9560f5e commit da3a175
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/tterrag/blur/Blur.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@ public class Blur {
private ShaderResourcePack dummyPack = new ShaderResourcePack();

@SuppressWarnings("unchecked")
public Blur() {
((List<IResourcePack>)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<IResourcePack>)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[] {
Expand Down Expand Up @@ -110,7 +112,6 @@ public void onConfigChanged(OnConfigChangedEvent event) {
}
}

@SuppressWarnings("null")
@SubscribeEvent
public void onGuiChange(GuiOpenEvent event) {
if (_listShaders == null) {
Expand All @@ -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()) {
Expand Down

0 comments on commit da3a175

Please sign in to comment.