添加lav滤镜

This commit is contained in:
Atsuihsio 2025-01-14 01:26:16 +08:00
parent 358a9b35fe
commit c1200ab55c

View file

@ -750,6 +750,15 @@ public class ClientEventHandler {
} }
} }
if (level != null && living.getVehicle() instanceof Lav150Entity vehicle) {
handleLandArmorCamera(event, vehicle);
} else {
var effect = Minecraft.getInstance().gameRenderer.currentEffect();
if (effect != null && effect.getName().equals(ModUtils.MODID + ":shaders/post/scan_pincushion.json")) {
Minecraft.getInstance().gameRenderer.shutdownEffect();
}
}
if (level != null && stack.is(ModTags.Items.GUN)) { if (level != null && stack.is(ModTags.Items.GUN)) {
handleWeaponSway(living); handleWeaponSway(living);
handleWeaponMove(living); handleWeaponMove(living);
@ -758,11 +767,12 @@ public class ClientEventHandler {
handleWeaponFire(event, living); handleWeaponFire(event, living);
handleWeaponShell(); handleWeaponShell();
handleGunRecoil(); handleGunRecoil();
handleShockCamera(event, living);
handleBowPullAnimation(living); handleBowPullAnimation(living);
handleWeaponDraw(living); handleWeaponDraw(living);
} }
handleShockCamera(event, living);
float times = Minecraft.getInstance().getDeltaFrameTime(); float times = Minecraft.getInstance().getDeltaFrameTime();
LocalPlayer player = Minecraft.getInstance().player; LocalPlayer player = Minecraft.getInstance().player;
@ -804,6 +814,12 @@ public class ClientEventHandler {
} }
} }
private static void handleLandArmorCamera(ViewportEvent.ComputeCameraAngles event, Lav150Entity entity) {
if (Minecraft.getInstance().gameRenderer.currentEffect() == null) {
Minecraft.getInstance().gameRenderer.loadEffect(ModUtils.loc("shaders/post/scan_pincushion.json"));
}
}
@SubscribeEvent @SubscribeEvent
public static void onRenderHand(RenderHandEvent event) { public static void onRenderHand(RenderHandEvent event) {
Player player = Minecraft.getInstance().player; Player player = Minecraft.getInstance().player;