Files
OpenPrestige/src/main/java/dev/zprestige/prestige/mixin/AbstractBlockStateMixin.java
T
bbldrizzyandClaude Sonnet 5.5 d3d4a988eb OpenPrestige
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 21:24:22 +01:00

30 lines
1.1 KiB
Java

package dev.zprestige.prestige.mixin;
import dev.zprestige.prestige.client.Prestige;
import dev.zprestige.prestige.event.BlockBoolEvent;
import dev.zprestige.prestige.util.ClientUtil;
import net.lenni0451.classtransform.InjectionCallback;
import net.lenni0451.classtransform.annotations.CTarget;
import net.lenni0451.classtransform.annotations.CTransformer;
import net.lenni0451.classtransform.annotations.injection.CInject;
import net.minecraft.block.AbstractBlock.AbstractBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
@CTransformer({AbstractBlockState.class})
public class AbstractBlockStateMixin {
@CInject(
method = {"getAmbientOcclusionLightLevel(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F"},
target = {@CTarget("RETURN")},
cancellable = true
)
private void a(BlockView blockView, BlockPos blockPos, InjectionCallback cir) {
if (ClientUtil.a(Prestige.eventBus, BlockBoolEvent.class)) {
BlockBoolEvent event = ClientUtil.b(null);
if (ClientUtil.c(event)) {
cir.setReturnValue(1.0F);
}
}
}
}