mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 06:51:32 +01:00
Time Changer / Weather Changer
This commit is contained in:
parent
e37065a457
commit
378e009d9a
@ -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;
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
@ -46,6 +46,8 @@
|
||||
"mixins.ChunkMixin",
|
||||
"mixins.ArmorStandRendererMixin",
|
||||
"mixins.RenderMixin",
|
||||
"accessors.FontRendererAccessor"
|
||||
"accessors.FontRendererAccessor",
|
||||
"mixins.FontRendererMixin",
|
||||
"mixins.WorldInfoMixin"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user