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.ModCategory;
import net.silentclient.client.mods.Setting;
import net.silentclient.client.utils.NotificationUtils;
import net.silentclient.client.utils.resource.SaturationResourceManager;
import java.io.IOException;
@ -38,8 +39,12 @@ public class ColorSaturationMod extends Mod {
}
public boolean isFastRenderEnabled() {
try {
return this.cachedFastRender.getBoolean(this.mc.gameSettings);
} catch (Exception exception) {
return false;
}
}
@Override
public void onChangeSettingValue(Setting setting) {
@ -107,7 +112,13 @@ public class ColorSaturationMod extends Mod {
}
@Override
public boolean isForceDisabled() {
return isFastRenderEnabled();
public void onEnable() {
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.mods.Mod;
import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.utils.NotificationUtils;
public class NewMotionBlurMod extends Mod {
private Field cachedFastRender;
public NewMotionBlurMod() {
super("Motion Blur", ModCategory.MODS, "silentclient/icons/mods/motionblur.png");
try {
this.cachedFastRender = GameSettings.class.getDeclaredField("ofFastRender");
} catch (Exception exception) {
}
}
@Override
public void setup() {
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");
}
}
}
}