From 312919daeaf7f1b01805d873c342886c848cbee6 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Sun, 2 Jun 2024 04:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=80=E7=81=AB=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/model/item/AK47ItemModel.java | 31 ++++++++------ .../client/model/item/Aa12ItemModel.java | 35 ++++++++-------- .../client/model/item/AbekiriItemModel.java | 29 +++++++++---- .../client/model/item/BocekItemModel.java | 29 +++++++++---- .../client/model/item/DevotionItemModel.java | 35 ++++++++-------- .../client/model/item/Hk416ItemModel.java | 33 +++++++++------ .../model/item/HuntingRifleItemModel.java | 33 ++++++++------- .../client/model/item/KraberItemModel.java | 37 +++++++++-------- .../target/client/model/item/M4ItemModel.java | 33 +++++++++------ .../client/model/item/M60ItemModel.java | 33 ++++++++------- .../client/model/item/M79ItemModel.java | 29 +++++++++---- .../client/model/item/M870ItemModel.java | 41 +++++++++---------- .../client/model/item/M98bItemModel.java | 35 ++++++++-------- .../client/model/item/MarlinItemModel.java | 41 +++++++++---------- .../client/model/item/MinigunItemModel.java | 29 +++++++++---- .../client/model/item/Mk14ItemModel.java | 33 ++++++++------- .../client/model/item/RpgItemModel.java | 30 ++++++++++---- .../client/model/item/RpkItemModel.java | 37 +++++++++-------- .../client/model/item/SentinelItemModel.java | 37 +++++++++-------- .../client/model/item/SksItemModel.java | 31 ++++++++------ .../client/model/item/SvdItemModel.java | 39 +++++++++--------- .../client/model/item/TaserItemModel.java | 28 ++++++++++--- .../model/item/TracheliumItemModel.java | 29 +++++++++---- .../client/model/item/VectorItemModel.java | 31 ++++++++------ .../target/event/ClientEventHandler.java | 17 +++++++- 25 files changed, 485 insertions(+), 330 deletions(-) diff --git a/src/main/java/net/mcreator/target/client/model/item/AK47ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/AK47ItemModel.java index 78f8bcb2e..40a1bb5e9 100644 --- a/src/main/java/net/mcreator/target/client/model/item/AK47ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/AK47ItemModel.java @@ -76,23 +76,28 @@ public class AK47ItemModel extends GeoModel { } double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.01f * (float) fp); - shen.setPosZ(0.4f * (float) fp); - shen.setRotX(0.003f * (float) fp); + shen.setPosY(-0.01f * (float) (fp + 2 * fr)); + shen.setPosZ(0.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setPosY(0.07f * (float) fp); - shen.setPosZ(1.01f * (float) fp); - shen.setRotX(0.025f * (float) fp); - shen.setRotZ(-0.04f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { - shen.setRotY(0.003f * (float) fp); - } else { - shen.setRotY(-0.003f * (float) fp); + shen.setPosY(-0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(0.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } shuan.setPosZ(2.4f * (float) fp); diff --git a/src/main/java/net/mcreator/target/client/model/item/Aa12ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/Aa12ItemModel.java index 7056235e0..78ca5a783 100644 --- a/src/main/java/net/mcreator/target/client/model/item/Aa12ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/Aa12ItemModel.java @@ -49,25 +49,28 @@ public class Aa12ItemModel extends GeoModel { gun.setScaleZ(1f - (0.4f * (float) p)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosZ(5f * (float) fp); + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(5f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setPosZ(6f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.03f * (float) fp); - } else { - shen.setRotX(0.06f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.007f * (float) fp); - } else { - shen.setRotZ(-0.007f * (float) fp); + shen.setPosY(0.08f * (float) (fp + 2 * fr)); + shen.setPosZ(6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/AbekiriItemModel.java b/src/main/java/net/mcreator/target/client/model/item/AbekiriItemModel.java index 54a1f0352..4c5c7cc2d 100644 --- a/src/main/java/net/mcreator/target/client/model/item/AbekiriItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/AbekiriItemModel.java @@ -49,17 +49,28 @@ public class AbekiriItemModel extends GeoModel { gun.setRotZ((float) (0.05f * zp)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - shen.setPosZ(4f * (float) fp); - - shen.setRotX(0.08f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(3f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.4f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.04f * (float) fr); + } else { + shen.setRotY(-0.04f * (float) fr); + } } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.08f * (float) (fp + 2 * fr)); + shen.setPosZ(4f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.5f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.16f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.09f * (float) fr); + } else { + shen.setRotY(-0.09f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/BocekItemModel.java b/src/main/java/net/mcreator/target/client/model/item/BocekItemModel.java index d4f02b5ff..5d31acf6f 100644 --- a/src/main/java/net/mcreator/target/client/model/item/BocekItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/BocekItemModel.java @@ -112,17 +112,28 @@ public class BocekItemModel extends GeoModel { double FirePosZ = 0; double FireRotX = 0; - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - fire.setPosZ(4f * (float) fp); - - fire.setRotX(0.02f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - fire.setRotZ(0.003f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + fire.setPosY(-0.01f * (float) (fp + 2 * fr)); + fire.setPosZ(3f * (float) (fp + 0.54f * fr)); + fire.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + fire.setRotY(0.015f * (float) fr); + } else { + fire.setRotY(-0.015f * (float) fr); + } } else { - fire.setRotZ(-0.003f * (float) fp); + fire.setPosY(-0.03f * (float) (fp + 2 * fr)); + fire.setPosZ(4f * (float) (fp + 0.54f * fr)); + fire.setRotX(0.07f * (float) (0.18f * fp + fr)); + fire.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + fire.setRotY(0.03f * (float) fr); + } else { + fire.setRotY(-0.03f * (float) fr); + } } CoreGeoBone root = getAnimationProcessor().getBone("root"); diff --git a/src/main/java/net/mcreator/target/client/model/item/DevotionItemModel.java b/src/main/java/net/mcreator/target/client/model/item/DevotionItemModel.java index 500ac60a2..6a6120822 100644 --- a/src/main/java/net/mcreator/target/client/model/item/DevotionItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/DevotionItemModel.java @@ -57,30 +57,33 @@ public class DevotionItemModel extends GeoModel { CoreGeoBone shen = getAnimationProcessor().getBone("shen"); CoreGeoBone number = getAnimationProcessor().getBone("number"); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - double bp = 0; bp = player.getPersistentData().getDouble("boltpos"); bolt.setPosZ(-2f * (float) bp); - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosZ(0.4f * (float) fp); - } else { - shen.setPosZ(0.75f * (float) fp); - } + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.002f * (float) fp); + shen.setPosY(-0.01f * (float) (fp + 2 * fr)); + shen.setPosZ(0.4f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.002f * (float) fp); - } else { - shen.setRotZ(-0.002f * (float) fp); + shen.setPosY(-0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(0.75f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.02f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } CoreGeoBone holo = getAnimationProcessor().getBone("holo"); diff --git a/src/main/java/net/mcreator/target/client/model/item/Hk416ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/Hk416ItemModel.java index 29febad35..742e9b3b3 100644 --- a/src/main/java/net/mcreator/target/client/model/item/Hk416ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/Hk416ItemModel.java @@ -58,7 +58,7 @@ public class Hk416ItemModel extends GeoModel { gun.setPosY(1.04f * (float) p - (float) (0.2f * zp)); - gun.setPosZ(3f * (float) p + (float) (0.3f * zp)); + gun.setPosZ(4f * (float) p + (float) (0.3f * zp)); gun.setRotZ((float) (0.05f * zp)); @@ -73,21 +73,28 @@ public class Hk416ItemModel extends GeoModel { holo.setScaleY(0); } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(0.8f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.002f * (float) fp); + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(0.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(1.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.03f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } CoreGeoBone root = getAnimationProcessor().getBone("root"); diff --git a/src/main/java/net/mcreator/target/client/model/item/HuntingRifleItemModel.java b/src/main/java/net/mcreator/target/client/model/item/HuntingRifleItemModel.java index f8d11d282..82c55ad39 100644 --- a/src/main/java/net/mcreator/target/client/model/item/HuntingRifleItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/HuntingRifleItemModel.java @@ -50,23 +50,28 @@ public class HuntingRifleItemModel extends GeoModel { gun.setScaleZ(1f - (0.1f * (float) p)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(4f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.5f * (float) fp); + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.1f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setPosY((float) fp); - } - - shen.setRotX(0.1f * (float) fp); - - if (Math.random() < 0.5) { - shen.setRotZ(0.005f * (float) fp); - } else { - shen.setRotZ(-0.005f * (float) fp); + shen.setPosY(0.7f * (float) (fp + 2 * fr)); + shen.setPosZ(4.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.1f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/KraberItemModel.java b/src/main/java/net/mcreator/target/client/model/item/KraberItemModel.java index 428416ad3..66b434afb 100644 --- a/src/main/java/net/mcreator/target/client/model/item/KraberItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/KraberItemModel.java @@ -43,27 +43,28 @@ public class KraberItemModel extends GeoModel { r.setRotX(-1.5f); } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosZ(3f * (float) fp); + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.1f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setPosZ(4f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.5f * (float) fp); - } else { - shen.setPosY((float) fp); - } - - shen.setRotX(0.1f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(1.2f * (float) (fp + 2 * fr)); + shen.setPosZ(7.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.1f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } double p = 0; diff --git a/src/main/java/net/mcreator/target/client/model/item/M4ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/M4ItemModel.java index 7a8908eee..826605619 100644 --- a/src/main/java/net/mcreator/target/client/model/item/M4ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/M4ItemModel.java @@ -45,27 +45,34 @@ public class M4ItemModel extends GeoModel { gun.setPosY(0.65f * (float) p - (float) (0.2f * zp)); - gun.setPosZ((float) p + (float) (0.6f * zp)); + gun.setPosZ(3f * (float) p + (float) (0.2f * zp)); gun.setScaleZ(1f - (0.2f * (float) p)); gun.setRotZ((float) (0.05f * zp)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(0.85f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.002f * (float) fp); + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(0.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(1.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.03f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/M60ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/M60ItemModel.java index 58f77b672..c669d0dd3 100644 --- a/src/main/java/net/mcreator/target/client/model/item/M60ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/M60ItemModel.java @@ -91,23 +91,28 @@ public class M60ItemModel extends GeoModel { gun.setRotZ(-0.087f * (float) p + (float) (0.05f * zp)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(1.25f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.008f * (float) fp); + shen.setPosY(-0.01f * (float) (fp + 2 * fr)); + shen.setPosZ(0.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - tiba.setRotZ(-0.2f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); - tiba.setRotZ(-0.25f * (float) fp); + shen.setPosY(-0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(0.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.04f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/M79ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/M79ItemModel.java index 17db10b73..811aa86d1 100644 --- a/src/main/java/net/mcreator/target/client/model/item/M79ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/M79ItemModel.java @@ -61,17 +61,28 @@ public class M79ItemModel extends GeoModel { flare.setRotZ(0); } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - shen.setPosZ(4f * (float) fp); - - shen.setRotX(0.1f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.1f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.7f * (float) (fp + 2 * fr)); + shen.setPosZ(4.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.1f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone root = getAnimationProcessor().getBone("root"); diff --git a/src/main/java/net/mcreator/target/client/model/item/M870ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/M870ItemModel.java index 329da870c..8f91d84d9 100644 --- a/src/main/java/net/mcreator/target/client/model/item/M870ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/M870ItemModel.java @@ -61,31 +61,28 @@ public class M870ItemModel extends GeoModel { gun.setScaleZ(1f - (0.2f * (float) p)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosZ(3f * (float) fp); + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.12f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setPosZ(4f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.01f * (float) fp); - } else { - shen.setPosY((float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.04f * (float) fp); - } else { - shen.setRotX(0.12f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.7f * (float) (fp + 2 * fr)); + shen.setPosZ(4.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.15f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/M98bItemModel.java b/src/main/java/net/mcreator/target/client/model/item/M98bItemModel.java index f28dca137..2d353e36e 100644 --- a/src/main/java/net/mcreator/target/client/model/item/M98bItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/M98bItemModel.java @@ -35,25 +35,28 @@ public class M98bItemModel extends GeoModel { Player player = Minecraft.getInstance().player; ItemStack stack = player.getMainHandItem(); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(3f * (float) fp); - - shi.setPosZ(60f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.25f * (float) fp); + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.12f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setPosY(0.5f * (float) fp); - } - - shen.setRotX(0.1f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.7f * (float) (fp + 2 * fr)); + shen.setPosZ(4.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.15f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } double p = 0; diff --git a/src/main/java/net/mcreator/target/client/model/item/MarlinItemModel.java b/src/main/java/net/mcreator/target/client/model/item/MarlinItemModel.java index 59e60f181..bd5a8d971 100644 --- a/src/main/java/net/mcreator/target/client/model/item/MarlinItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/MarlinItemModel.java @@ -52,31 +52,28 @@ public class MarlinItemModel extends GeoModel { gun.setScaleZ(1f - (0.2f * (float) p)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosZ(1.5f * (float) fp); + shen.setPosY(-0.01f * (float) (fp + 2 * fr)); + shen.setPosZ(1.4f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setPosZ(2f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.01f * (float) fp); - } else { - shen.setPosY((float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.04f * (float) fp); - } else { - shen.setRotX(0.12f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(-0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(1.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/MinigunItemModel.java b/src/main/java/net/mcreator/target/client/model/item/MinigunItemModel.java index 637d55772..9d01653ad 100644 --- a/src/main/java/net/mcreator/target/client/model/item/MinigunItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/MinigunItemModel.java @@ -45,17 +45,28 @@ public class MinigunItemModel extends GeoModel { gun.setRotZ((float) (gun.getRotZ() + times * -0.008f * stack.getOrCreateTag().getDouble("minigun_rotation"))); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - shen.setPosZ((float) fp); - - shen.setRotX(0.02f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(0.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(1.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.03f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } if (stack.getOrCreateTag().getInt("fire_animation") > 0) { diff --git a/src/main/java/net/mcreator/target/client/model/item/Mk14ItemModel.java b/src/main/java/net/mcreator/target/client/model/item/Mk14ItemModel.java index 43a66138b..8773a62dd 100644 --- a/src/main/java/net/mcreator/target/client/model/item/Mk14ItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/Mk14ItemModel.java @@ -65,23 +65,28 @@ public class Mk14ItemModel extends GeoModel { CoreGeoBone shen = getAnimationProcessor().getBone("shen"); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(3f * (float) fp); - - shuan.setPosZ(6f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.001f * (float) fp); + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(2.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(3.5f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } if (gun.getPosX() > 5.5f) { diff --git a/src/main/java/net/mcreator/target/client/model/item/RpgItemModel.java b/src/main/java/net/mcreator/target/client/model/item/RpgItemModel.java index 2912fc6b2..92bf4a75c 100644 --- a/src/main/java/net/mcreator/target/client/model/item/RpgItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/RpgItemModel.java @@ -1,6 +1,7 @@ package net.mcreator.target.client.model.item; import net.mcreator.target.item.gun.RpgItem; +import net.mcreator.target.network.TargetModVariables; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; @@ -41,17 +42,28 @@ public class RpgItemModel extends GeoModel { rocket.setScaleZ(0); } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - shen.setPosZ((float) fp); - - shen.setRotX(0.05f * (float) fp); - - if (Math.random() < 0.5) { - shen.setRotZ(0.01f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(1.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotZ(-0.01f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(1.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } double p = 0; diff --git a/src/main/java/net/mcreator/target/client/model/item/RpkItemModel.java b/src/main/java/net/mcreator/target/client/model/item/RpkItemModel.java index 99b03fc91..a52381487 100644 --- a/src/main/java/net/mcreator/target/client/model/item/RpkItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/RpkItemModel.java @@ -48,9 +48,9 @@ public class RpkItemModel extends GeoModel { gun.setPosX(1.69f * (float) p); - gun.setPosY(-0.33f * (float) p - (float) (0.6f * zp)); + gun.setPosY(-0.33f * (float) p - (float) (0.1f * zp)); - gun.setPosZ(3.2f * (float) p + (float) (0.5f * zp)); + gun.setPosZ(3.2f * (float) p + (float) (0.2f * zp)); gun.setRotZ((float) (0.05f * zp)); @@ -82,25 +82,30 @@ public class RpkItemModel extends GeoModel { } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ((float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.002f * (float) fp); + shen.setPosY(-0.01f * (float) (fp + 2 * fr)); + shen.setPosZ(0.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); + shen.setPosY(-0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(0.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.04f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); - } - - shuan.setPosZ(2.4f * (float) fp); - if (stack.getOrCreateTag().getDouble("flash_time") > 0) { flare.setScaleX((float) (1.0 + 0.5 * (Math.random() - 0.5))); flare.setScaleY((float) (1.0 + 0.5 * (Math.random() - 0.5))); diff --git a/src/main/java/net/mcreator/target/client/model/item/SentinelItemModel.java b/src/main/java/net/mcreator/target/client/model/item/SentinelItemModel.java index 2721f0775..b6ee3b666 100644 --- a/src/main/java/net/mcreator/target/client/model/item/SentinelItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/SentinelItemModel.java @@ -77,27 +77,28 @@ public class SentinelItemModel extends GeoModel { holo.setScaleY(0); } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosZ(3f * (float) fp); + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.12f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setPosZ(5f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.3f * (float) fp); - } else { - shen.setPosY(1.3f * (float) fp); - } - - shen.setRotX(0.1f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.7f * (float) (fp + 2 * fr)); + shen.setPosZ(4.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.15f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone charge = getAnimationProcessor().getBone("charge"); diff --git a/src/main/java/net/mcreator/target/client/model/item/SksItemModel.java b/src/main/java/net/mcreator/target/client/model/item/SksItemModel.java index 9eafce45a..68ab223dc 100644 --- a/src/main/java/net/mcreator/target/client/model/item/SksItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/SksItemModel.java @@ -67,21 +67,28 @@ public class SksItemModel extends GeoModel { CoreGeoBone shen = getAnimationProcessor().getBone("shen"); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ((float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.002f * (float) fp); + shen.setPosY(-0.01f * (float) (fp + 2 * fr)); + shen.setPosZ(0.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(-0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(1.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } shuan.setPosZ(2.5f * (float) fp); diff --git a/src/main/java/net/mcreator/target/client/model/item/SvdItemModel.java b/src/main/java/net/mcreator/target/client/model/item/SvdItemModel.java index 5608c19b7..da32132cc 100644 --- a/src/main/java/net/mcreator/target/client/model/item/SvdItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/SvdItemModel.java @@ -90,31 +90,30 @@ public class SvdItemModel extends GeoModel { CoreGeoBone shen = getAnimationProcessor().getBone("shen"); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(1.8f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setPosY(0.1f * (float) fp); + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(1.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setPosY(0.2f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(1.8f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.07f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.03f * (float) fr); + } else { + shen.setRotY(-0.03f * (float) fr); + } } - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.002f * (float) fp); - } else { - shen.setRotX(0.08f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); - } - - shuan.setPosZ(2.4f * (float) fp); - holo.setPosY(1.1f * (float) fp); holo.setRotZ(-0.04f * (float) fp); diff --git a/src/main/java/net/mcreator/target/client/model/item/TaserItemModel.java b/src/main/java/net/mcreator/target/client/model/item/TaserItemModel.java index 0ced41833..352238cff 100644 --- a/src/main/java/net/mcreator/target/client/model/item/TaserItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/TaserItemModel.java @@ -1,6 +1,7 @@ package net.mcreator.target.client.model.item; import net.mcreator.target.item.gun.Taser; +import net.mcreator.target.network.TargetModVariables; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; @@ -31,12 +32,29 @@ public class TaserItemModel extends GeoModel { Player player = Minecraft.getInstance().player; - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - shen.setPosZ(0.75f * (float) fp); - - shen.setRotX(0.02f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(0.5f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.02f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.0025f * (float) fr); + } else { + shen.setRotY(-0.0025f * (float) fr); + } + } else { + shen.setPosY(0.03f * (float) (fp + 2 * fr)); + shen.setPosZ(0.7f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.03f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.001f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.0045f * (float) fr); + } else { + shen.setRotY(-0.0045f * (float) fr); + } + } double p = 0; p = player.getPersistentData().getDouble("zoom_pos"); diff --git a/src/main/java/net/mcreator/target/client/model/item/TracheliumItemModel.java b/src/main/java/net/mcreator/target/client/model/item/TracheliumItemModel.java index 05cfb6b09..910a32a89 100644 --- a/src/main/java/net/mcreator/target/client/model/item/TracheliumItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/TracheliumItemModel.java @@ -50,17 +50,28 @@ public class TracheliumItemModel extends GeoModel { gun.setScaleZ(1f - (0.2f * (float) p)); - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); - shen.setPosZ(4f * (float) fp); - - shen.setRotX(0.2f * (float) fp); - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { + shen.setPosY(0.4f * (float) (fp + 2 * fr)); + shen.setPosZ(3.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.12f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.025f * (float) fr); + } else { + shen.setRotY(-0.025f * (float) fr); + } } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.7f * (float) (fp + 2 * fr)); + shen.setPosZ(4.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.15f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone flare = getAnimationProcessor().getBone("flare"); diff --git a/src/main/java/net/mcreator/target/client/model/item/VectorItemModel.java b/src/main/java/net/mcreator/target/client/model/item/VectorItemModel.java index c39e9408d..819de8984 100644 --- a/src/main/java/net/mcreator/target/client/model/item/VectorItemModel.java +++ b/src/main/java/net/mcreator/target/client/model/item/VectorItemModel.java @@ -66,21 +66,28 @@ public class VectorItemModel extends GeoModel { holo.setScaleY(0); } - double fp = 0; - fp = player.getPersistentData().getDouble("fire_pos"); - - shen.setPosZ(0.75f * (float) fp); + double fp = player.getPersistentData().getDouble("fire_pos"); + double fr = player.getPersistentData().getDouble("fire_rot"); if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { - shen.setRotX(0.0002f * (float) fp); + shen.setPosY(0.02f * (float) (fp + 2 * fr)); + shen.setPosZ(0.6f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.003f * (float) (fp + fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.015f * (float) fr); + } else { + shen.setRotY(-0.015f * (float) fr); + } } else { - shen.setRotX(0.02f * (float) fp); - } - - if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) { - shen.setRotZ(0.003f * (float) fp); - } else { - shen.setRotZ(-0.003f * (float) fp); + shen.setPosY(0.04f * (float) (fp + 2 * fr)); + shen.setPosZ(1.2f * (float) (fp + 0.54f * fr)); + shen.setRotX(0.03f * (float) (0.18f * fp + fr)); + shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr)); + if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) { + shen.setRotY(0.045f * (float) fr); + } else { + shen.setRotY(-0.045f * (float) fr); + } } CoreGeoBone root = getAnimationProcessor().getBone("root"); diff --git a/src/main/java/net/mcreator/target/event/ClientEventHandler.java b/src/main/java/net/mcreator/target/event/ClientEventHandler.java index 02c707991..81a9d5c61 100644 --- a/src/main/java/net/mcreator/target/event/ClientEventHandler.java +++ b/src/main/java/net/mcreator/target/event/ClientEventHandler.java @@ -342,13 +342,13 @@ public class ClientEventHandler { if ((entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) { if (data.getDouble("zoom_time") < 1) { data.putDouble("zoom_time", - (data.getDouble("zoom_time") + entity.getMainHandItem().getOrCreateTag().getDouble("zoom_speed") * 0.02 * times)); + (data.getDouble("zoom_time") + entity.getMainHandItem().getOrCreateTag().getDouble("zoom_speed") * 0.03 * times)); } else { data.putDouble("zoom_time", 1); } } else { if (data.getDouble("zoom_time") > 0) { - data.putDouble("zoom_time", (data.getDouble("zoom_time") - 0.02 * times)); + data.putDouble("zoom_time", (data.getDouble("zoom_time") - 0.04 * times)); } else { data.putDouble("zoom_time", 0); } @@ -390,6 +390,7 @@ public class ClientEventHandler { var capability = entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null); if (capability.orElse(new TargetModVariables.PlayerVariables()).firing > 0) { data.putDouble("firetime", 0.2); + data.putDouble("fire_rotx_time", 0.2); if (0.3 > data.getDouble("firepos2")) { data.putDouble("firepos2", (data.getDouble("firepos2") + 0.04 * times)); } @@ -428,6 +429,15 @@ public class ClientEventHandler { event.setRoll((float) (roll - amplitude * (4.34 * Math.pow(data.getDouble("firetime"), 2) - 5.5 * data.getDouble("firetime") + 2.167 + 0.7 * (2 * Math.random() - 1)))); } } + + if (0 < data.getDouble("fire_rotx_time") && data.getDouble("fire_rotx_time") < 2) { + data.putDouble("fire_rotx_time", (data.getDouble("fire_rotx_time") + 0.1 * (2.3 - data.getDouble("fire_rotx_time")) * times)); + } + + if (0 < data.getDouble("fire_rotx_time") && data.getDouble("fire_rotx_time") < 2) { + data.putDouble("fire_rot", + (pose * (1 / 6.3 * (data.getDouble("fire_rotx_time") - 0.5)) * Math.sin(6.3 * (data.getDouble("fire_rotx_time") - 0.5)) * (2.5 - data.getDouble("fire_rotx_time")))); + } if (0 <= data.getDouble("firetime") && data.getDouble("firetime") <= 0.25) { data.putDouble("boltpos", (-Math.pow(8 * data.getDouble("firetime") - 1, 2) + 1)); } @@ -437,6 +447,9 @@ public class ClientEventHandler { if (data.getDouble("firetime") >= 1) { data.putDouble("firetime", 0); } + if (data.getDouble("fire_rotx_time") >= 2) { + data.putDouble("fire_rotx_time", 0); + } } private static void handleShockCamera(ViewportEvent.ComputeCameraAngles event, LivingEntity entity) {