调整屏幕抖动
This commit is contained in:
parent
e6e6f69e58
commit
e07d2c0a61
1 changed files with 4 additions and 4 deletions
|
@ -735,8 +735,8 @@ public class ClientEventHandler {
|
||||||
public static void handleShakeClient(double time, double radius, double amplitude, double x, double y, double z) {
|
public static void handleShakeClient(double time, double radius, double amplitude, double x, double y, double z) {
|
||||||
Player player = Minecraft.getInstance().player;
|
Player player = Minecraft.getInstance().player;
|
||||||
if (player == null) return;
|
if (player == null) return;
|
||||||
double shakeStrength = DisplayConfig.EXPLOSION_SCREEN_SHAKE.get() / 100.0;
|
float shakeStrength = (float) DisplayConfig.EXPLOSION_SCREEN_SHAKE.get() / 100.0f;
|
||||||
if (shakeStrength <= 0.0) return;
|
if (shakeStrength <= 0.0f) return;
|
||||||
|
|
||||||
shakeTime = time;
|
shakeTime = time;
|
||||||
shakeRadius = radius;
|
shakeRadius = radius;
|
||||||
|
@ -1373,7 +1373,7 @@ public class ClientEventHandler {
|
||||||
|
|
||||||
private static void handleShockCamera(ViewportEvent.ComputeCameraAngles event, LivingEntity entity) {
|
private static void handleShockCamera(ViewportEvent.ComputeCameraAngles event, LivingEntity entity) {
|
||||||
if (entity.hasEffect(ModMobEffects.SHOCK) && Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON) {
|
if (entity.hasEffect(ModMobEffects.SHOCK) && Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON) {
|
||||||
float shakeStrength = (float) (DisplayConfig.SHOCK_SCREEN_SHAKE.get() / 100.0);
|
float shakeStrength = (float) DisplayConfig.SHOCK_SCREEN_SHAKE.get() / 100.0f;
|
||||||
if (shakeStrength <= 0.0f) return;
|
if (shakeStrength <= 0.0f) return;
|
||||||
|
|
||||||
event.setYaw(Minecraft.getInstance().gameRenderer.getMainCamera().getYRot() +
|
event.setYaw(Minecraft.getInstance().gameRenderer.getMainCamera().getYRot() +
|
||||||
|
@ -1387,7 +1387,7 @@ public class ClientEventHandler {
|
||||||
public static void handleReloadShake(double boneRotX, double boneRotY, double boneRotZ) {
|
public static void handleReloadShake(double boneRotX, double boneRotY, double boneRotZ) {
|
||||||
LocalPlayer player = Minecraft.getInstance().player;
|
LocalPlayer player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
float shakeStrength = (float) (DisplayConfig.WEAPON_SCREEN_SHAKE.get() / 100.0);
|
float shakeStrength = (float) DisplayConfig.WEAPON_SCREEN_SHAKE.get() / 100.0f;
|
||||||
if (shakeStrength <= 0.0f) return;
|
if (shakeStrength <= 0.0f) return;
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue