Time Changer / Weather Changer

This commit is contained in:
kirillsaint 2023-07-01 16:43:45 +06:00
parent e37065a457
commit 378e009d9a
3 changed files with 28 additions and 5 deletions

View File

@ -0,0 +1,25 @@
package net.silentclient.client.mixin.mixins;
import net.minecraft.world.storage.WorldInfo;
import net.silentclient.client.Client;
import net.silentclient.client.mods.world.TimeChangerMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(WorldInfo.class)
public class WorldInfoMixin {
@Shadow
private long worldTime;
/**
* @author kirillsaint
* @reason Time Changer Mod
*/
@Overwrite
public void setWorldTime(long time) {
boolean toggle = Client.getInstance().getModInstances().getModByClass(TimeChangerMod.class).isToggled();
long customTime = (long) Client.getInstance().getSettingsManager().getSettingByClass(TimeChangerMod.class, "Time").getValDouble();
this.worldTime = toggle ? customTime : time;
}
}

View File

@ -49,10 +49,6 @@ public class WeatherChangerMod extends Mod {
mc.theWorld.setRainStrength(0);
mc.theWorld.setThunderStrength(0);
break;
case "Clear":
mc.theWorld.setRainStrength(0);
mc.theWorld.setThunderStrength(0);
break;
case "Rain":
mc.theWorld.setRainStrength(1);
mc.theWorld.setThunderStrength(0);

View File

@ -46,6 +46,8 @@
"mixins.ChunkMixin",
"mixins.ArmorStandRendererMixin",
"mixins.RenderMixin",
"accessors.FontRendererAccessor"
"accessors.FontRendererAccessor",
"mixins.FontRendererMixin",
"mixins.WorldInfoMixin"
]
}