forked from lambda-client/lambda-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMixinWorld.java
More file actions
42 lines (37 loc) · 1.69 KB
/
MixinWorld.java
File metadata and controls
42 lines (37 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.lambda.mixin.world;
import com.lambda.client.module.modules.misc.AntiWeather;
import com.lambda.client.module.modules.render.TimeWarp;
import com.lambda.client.module.modules.render.NoRender;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(value = World.class, priority = Integer.MAX_VALUE)
public class MixinWorld {
@Inject(method = "checkLightFor", at = @At("HEAD"), cancellable = true)
private void checkLightForHead(EnumSkyBlock lightType, BlockPos pos, CallbackInfoReturnable<Boolean> ci) {
if (NoRender.INSTANCE.handleLighting(lightType)) {
ci.setReturnValue(false);
}
}
@Inject(method = "getThunderStrength", at = @At("HEAD"), cancellable = true)
private void getThunderStrengthHead(float delta, CallbackInfoReturnable<Float> cir) {
if (AntiWeather.INSTANCE.isEnabled()) {
cir.setReturnValue(0.0f);
}
}
@Inject(method = "getRainStrength", at = @At("HEAD"), cancellable = true)
private void getRainStrengthHead(float delta, CallbackInfoReturnable<Float> cir) {
if (AntiWeather.INSTANCE.isEnabled()) {
cir.setReturnValue(0.0f);
}
}
@Inject(method = "getWorldTime", at = @At("HEAD"), cancellable = true)
public void onGetWorldTime(CallbackInfoReturnable<Long> cir) {
if (TimeWarp.INSTANCE.isEnabled())
cir.setReturnValue(TimeWarp.INSTANCE.getUpdatedTime());
}
}