blob: c4da4792de403d51a23832194fe5baf9c71771e1 (
plain)
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
|
package net.justlearning.arslaan3102.arslaansmagichax.mixin;
import net.justlearning.arslaan3102.arslaansmagichax.ArslaansMagicHaxClient;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
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;
import java.util.Objects;
@Mixin(AbstractBlock.class)
public class AbstractBlockMixin {
private static MinecraftClient mc = MinecraftClient.getInstance();
@Inject(method = "getAmbientOcclusionLightLevel", at = @At("HEAD"), cancellable = true)
private void onGetAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable<Float> cir) {
if (mc == null) mc = MinecraftClient.getInstance(); // just in case :)
if (mc != null) {
if (mc.world != null && (ArslaansMagicHaxClient.fullbright.isEnabled())) {
if (Objects.equals(ArslaansMagicHaxClient.fullbright.mode.getMode(), "Break AO Renderer")) {
cir.setReturnValue(15.0F); // over the limit of 1.0F, breaks the ambient occlusion renderer and messes everything up :) yay
} else {
cir.setReturnValue(1.0F);
}
}
}
}
}
|