This commit is contained in:
kirillsaint 2023-07-04 12:34:28 +06:00
parent 11e6ff9506
commit c578cdec51
2 changed files with 42 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import net.silentclient.client.mixin.accessors.SimpleReloadableResourceManagerAc
import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.mods.Setting; import net.silentclient.client.mods.Setting;
import net.silentclient.client.utils.NotificationUtils;
import net.silentclient.client.utils.resource.SaturationResourceManager; import net.silentclient.client.utils.resource.SaturationResourceManager;
import java.io.IOException; import java.io.IOException;
@ -38,7 +39,11 @@ public class ColorSaturationMod extends Mod {
} }
public boolean isFastRenderEnabled() { public boolean isFastRenderEnabled() {
return false; try {
return this.cachedFastRender.getBoolean(this.mc.gameSettings);
} catch (Exception exception) {
return false;
}
} }
@Override @Override
@ -105,9 +110,15 @@ public class ColorSaturationMod extends Mod {
return null; return null;
} }
} }
@Override @Override
public boolean isForceDisabled() { public void onEnable() {
return isFastRenderEnabled(); super.onEnable();
if(isFastRenderEnabled()) {
this.toggle();
if(mc.thePlayer != null) {
NotificationUtils.showNotification("error", "Disable Fast Render");
}
}
} }
} }

View File

@ -6,14 +6,41 @@ import net.minecraft.client.settings.GameSettings;
import net.silentclient.client.Client; import net.silentclient.client.Client;
import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.utils.NotificationUtils;
public class NewMotionBlurMod extends Mod { public class NewMotionBlurMod extends Mod {
private Field cachedFastRender;
public NewMotionBlurMod() { public NewMotionBlurMod() {
super("Motion Blur", ModCategory.MODS, "silentclient/icons/mods/motionblur.png"); super("Motion Blur", ModCategory.MODS, "silentclient/icons/mods/motionblur.png");
try {
this.cachedFastRender = GameSettings.class.getDeclaredField("ofFastRender");
} catch (Exception exception) {
}
} }
@Override @Override
public void setup() { public void setup() {
this.addSliderSetting("Amount", this, 0.5, 0.1, 0.85, false); this.addSliderSetting("Amount", this, 0.5, 0.1, 0.85, false);
} }
public boolean isFastRenderEnabled() {
try {
return this.cachedFastRender.getBoolean(this.mc.gameSettings);
} catch (Exception exception) {
return false;
}
}
@Override
public void onEnable() {
super.onEnable();
if(isFastRenderEnabled()) {
this.toggle();
if(mc.thePlayer != null) {
NotificationUtils.showNotification("error", "Disable Fast Render");
}
}
}
} }