Search in sources :

Example 1 with MotionBlurResourceManager

use of cc.hyperium.mods.motionblur.resource.MotionBlurResourceManager in project Hyperium by HyperiumClient.

the class MotionBlurMod method onClientTick.

@InvokeEvent
public void onClientTick(TickEvent event) {
    if (Settings.MOTION_BLUR_ENABLED && !Minecraft.getMinecraft().entityRenderer.isShaderActive() && mc.theWorld != null && !isFastRenderEnabled()) {
        applyShader();
    }
    if (domainResourceManagers == null) {
        try {
            Field[] var2 = SimpleReloadableResourceManager.class.getDeclaredFields();
            for (Field field : var2) {
                if (field.getType() == Map.class) {
                    field.setAccessible(true);
                    domainResourceManagers = (Map) field.get(Minecraft.getMinecraft().getResourceManager());
                    break;
                }
            }
        } catch (Exception var6) {
            throw new RuntimeException(var6);
        }
    }
    if (!domainResourceManagers.containsKey("motionblur")) {
        domainResourceManagers.put("motionblur", new MotionBlurResourceManager());
    }
}
Also used : Field(java.lang.reflect.Field) MotionBlurResourceManager(cc.hyperium.mods.motionblur.resource.MotionBlurResourceManager) InvokeEvent(cc.hyperium.event.InvokeEvent)

Aggregations

InvokeEvent (cc.hyperium.event.InvokeEvent)1 MotionBlurResourceManager (cc.hyperium.mods.motionblur.resource.MotionBlurResourceManager)1 Field (java.lang.reflect.Field)1