添加准星旋转

This commit is contained in:
Atsuihsio 2024-12-24 21:02:44 +08:00
parent 3d1cf74f01
commit eb675e7cf4
33 changed files with 116 additions and 13 deletions

View file

@ -2,11 +2,12 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.tools.GunsTool;
import com.atsuishio.superbwarfare.item.gun.rifle.AK12Item;
import com.atsuishio.superbwarfare.tools.GunsTool;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -139,6 +140,8 @@ public class AK12ItemModel extends GeoModel<AK12Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.85 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
shuan.setPosZ(2.4f * (float) fp);
cross3.setRotZ(0.01f * (float) (ClientEventHandler.recoilHorizon * fp));

View file

@ -1,12 +1,13 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.tools.GunsTool;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.rifle.AK47Item;
import com.atsuishio.superbwarfare.tools.GunsTool;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -143,6 +144,8 @@ public class AK47ItemModel extends GeoModel<AK47Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.85 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
shuan.setPosZ(2.4f * (float) fp);
cross3.setRotZ(0.01f * (float) (ClientEventHandler.recoilHorizon * fp));

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.shotgun.Aa12Item;
@ -79,6 +80,8 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.shotgun.AbekiriItem;
@ -75,6 +76,8 @@ public class AbekiriItemModel extends GeoModel<AbekiriItem> {
shen.setRotY((float) (0.1f * ClientEventHandler.recoilHorizon * fpz));
shen.setRotZ((float) ((0.08f + 0.1 * fr) * ClientEventHandler.recoilHorizon));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.special.BocekItem;
@ -112,6 +113,8 @@ public class BocekItemModel extends GeoModel<BocekItem> {
fire.setRotY((float) (0.01f * ClientEventHandler.recoilHorizon * fpz));
fire.setRotZ((float) ((0.02f + 0.1 * fr) * ClientEventHandler.recoilHorizon));
CrossHairOverlay.gunRot = fire.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -1,9 +1,10 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.machinegun.DevotionItem;
import net.minecraft.client.Minecraft;
@ -87,6 +88,8 @@ public class DevotionItemModel extends GeoModel<DevotionItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.9 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.9 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
bolt.setPosZ(-2f * (float) fp);
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.handgun.Glock17Item;
@ -86,6 +87,8 @@ public class Glock17ItemModel extends GeoModel<Glock17Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
slide.setPosZ(1.5f * (float) fp);
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.handgun.Glock18Item;
@ -95,6 +96,8 @@ public class Glock18ItemModel extends GeoModel<Glock18Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
slide.setPosZ(1.5f * (float) fp);
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -1,12 +1,13 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.tools.GunsTool;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.rifle.Hk416Item;
import com.atsuishio.superbwarfare.tools.GunsTool;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -137,6 +138,8 @@ public class Hk416ItemModel extends GeoModel<Hk416Item> {
shen.setRotY((float) (shen.getRotY() * (1 - (type == 3 ? 0.95 : 0.9) * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
cross1.setPosY(-0.75f * (float) fpz);
cross2.setPosY(-0.7f * (float) fpz);
cross3.setPosY(-0.2f * (float) fpz);

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.sniper.HuntingRifleItem;
@ -83,6 +84,8 @@ public class HuntingRifleItemModel extends GeoModel<HuntingRifleItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -1,9 +1,10 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.item.gun.launcher.JavelinItem;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.launcher.JavelinItem;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -74,6 +75,8 @@ public class JavelinItemModel extends GeoModel<JavelinItem> {
shen.setRotY((float) (0.07f * ClientEventHandler.recoilHorizon * fpz));
shen.setRotZ((float) ((0.08f + 0.1 * fr) * ClientEventHandler.recoilHorizon));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.sniper.K98Item;
@ -90,6 +91,8 @@ public class K98ItemModel extends GeoModel<K98Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.handgun.M1911Item;
@ -85,6 +86,8 @@ public class M1911ItemModel extends GeoModel<M1911Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
slide.setPosZ(2.75f * (float) fp);
hammer.setRotX(60 * Mth.DEG_TO_RAD + (120 * Mth.DEG_TO_RAD * (float) fp));

View file

@ -1,12 +1,13 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.tools.GunsTool;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.rifle.M4Item;
import com.atsuishio.superbwarfare.tools.GunsTool;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -166,6 +167,8 @@ public class M4ItemModel extends GeoModel<M4Item> {
shen.setRotY((float) (shen.getRotY() * (1 - (type == 3 ? 0.95 : 0.9) * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
int BarrelType = GunsTool.getAttachmentType(stack, GunsTool.AttachmentType.BARREL);

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
@ -128,6 +129,8 @@ public class M60ItemModel extends GeoModel<M60Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.9 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.9 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
tiba.setRotZ((float) (-0.25f * fp + 0.4 * fr));
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.launcher.M79Item;
@ -81,6 +82,8 @@ public class M79ItemModel extends GeoModel<M79Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.shotgun.M870Item;
@ -82,6 +83,7 @@ public class M870ItemModel extends GeoModel<M870Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.sniper.M98bItem;
@ -76,6 +77,8 @@ public class M98bItemModel extends GeoModel<M98bItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
scope.setPosZ(75.2f * (float) (fp + 0.54f * fr));
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.rifle.MarlinItem;
@ -79,6 +80,8 @@ public class MarlinItemModel extends GeoModel<MarlinItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
if (stack.getOrCreateTag().getBoolean("empty")) {
jichui.setRotX(-0.52f);
}

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.machinegun.MinigunItem;
@ -68,6 +69,8 @@ public class MinigunItemModel extends GeoModel<MinigunItem> {
shen.setRotY((float) (0.02f * ClientEventHandler.recoilHorizon * fpz));
shen.setRotZ((float) ((0.02f + 0.02 * fr) * ClientEventHandler.recoilHorizon));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone root = getAnimationProcessor().getBone("root");
root.setPosX((float) (movePosX + 20 * ClientEventHandler.drawTime + 9.3f * mph));
root.setPosY((float) (swayY + movePosY - 40 * ClientEventHandler.drawTime - 2f * vY));

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
@ -132,6 +133,8 @@ public class Mk14ItemModel extends GeoModel<Mk14Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.85 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
action.setPosZ(2.5f * (float) fp);
stack.getOrCreateTag().putBoolean("HoloHidden", !(gun.getPosX() > 2.5));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.sniper.MosinNagantItem;
@ -99,6 +100,8 @@ public class MosinNagantItemModel extends GeoModel<MosinNagantItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
rex.setPosY(0.05f + 0.1f * (float) fp);
rex.setRotZ((float) (-0.08f * fp * ClientEventHandler.recoilHorizon * fp));

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
@ -84,6 +85,8 @@ public class Ntw20Model extends GeoModel<Ntw20Item> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
gun.setPosX(4.54f * (float) zp);
gun.setPosY(-0.45f * (float) zp - (float) (0.2f * zpz));
gun.setPosZ(10.0f * (float) zp + (float) (0.3f * zpz));

View file

@ -1,12 +1,13 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.tools.GunsTool;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.rifle.Qbz95Item;
import com.atsuishio.superbwarfare.tools.GunsTool;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -150,6 +151,8 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
shen.setRotY((float) (shen.getRotY() * (1 - (type == 3 ? 0.95 : 0.9) * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
bolt.setPosZ(5f * (float) fp);
cross1.setPosY(-0.75f * (float) fpz);

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.launcher.RpgItem;
@ -78,6 +79,8 @@ public class RpgItemModel extends GeoModel<RpgItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
gun.setPosX(0.91f * (float) zp);
gun.setPosY(-0.04f * (float) zp - (float) (0.2f * zpz));
gun.setPosZ(2f * (float) zp + (float) (0.15f * zpz));

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.machinegun.RpkItem;
@ -88,6 +89,8 @@ public class RpkItemModel extends GeoModel<RpkItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.9 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.9 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
shuan.setPosZ(2.4f * (float) fp);
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.sniper.SentinelItem;
@ -89,6 +90,8 @@ public class SentinelItemModel extends GeoModel<SentinelItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CoreGeoBone charge = getAnimationProcessor().getBone("charge");
charge.setRotZ(charge.getRotZ() + times * 0.5f);

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.rifle.SksItem;
@ -82,6 +83,8 @@ public class SksItemModel extends GeoModel<SksItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.9 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.9 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
shuan.setPosZ(2f * (float) fp);
CoreGeoBone root = getAnimationProcessor().getBone("root");

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.sniper.SvdItem;
@ -100,6 +101,8 @@ public class SvdItemModel extends GeoModel<SvdItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
holo.setPosY(0.05f + 1.1f * (float) fp);
holo.setRotZ(-0.04f * (float) fp);
holo.setScaleX(0.75f);

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.special.TaserItem;
@ -73,6 +74,8 @@ public class TaserItemModel extends GeoModel<TaserItem> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.9 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.9 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
gun.setPosX(1.82f * (float) zp);
gun.setPosY(1.3f * (float) zp - (float) (0.3f * zpz));
gun.setPosZ((float) zp + (float) (0.5f * zpz));

View file

@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
@ -147,6 +148,8 @@ public class TracheliumItemModel extends GeoModel<Trachelium> {
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
stack.getOrCreateTag().putBoolean("HoloHidden", (gun.getPosX() <= 3 || Mth.abs(shen.getRotX()) > (scopeType == 2 ? 3 : 1) * Mth.DEG_TO_RAD || Mth.abs(main.getRotX()) > (scopeType == 2 ? 5.7 : 1) * Mth.DEG_TO_RAD || Mth.abs(main.getRotY()) > 3 * Mth.DEG_TO_RAD));
hammer.setRotX(50 * Mth.DEG_TO_RAD * (float) ClientEventHandler.revolverPreTime);

View file

@ -1,12 +1,13 @@
package com.atsuishio.superbwarfare.client.model.item;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.tools.GunsTool;
import com.atsuishio.superbwarfare.client.AnimationHelper;
import com.atsuishio.superbwarfare.client.screens.CrossHairOverlay;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.event.PlayerEventHandler;
import com.atsuishio.superbwarfare.init.ModTags;
import com.atsuishio.superbwarfare.item.gun.smg.VectorItem;
import com.atsuishio.superbwarfare.tools.GunsTool;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
@ -126,6 +127,8 @@ public class VectorItemModel extends GeoModel<VectorItem> {
shen.setRotY((float) (shen.getRotY() * (1 - (type == 3 ? 0.95 : 0.9) * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.4 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
cross1.setPosY(-0.25f * (float) fpz);
rotXSight = Mth.lerp(1.5f * times, rotXSight, type == 0 ? 0 : 90);

View file

@ -12,6 +12,8 @@ import com.atsuishio.superbwarfare.perk.Perk;
import com.atsuishio.superbwarfare.perk.PerkHelper;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.minecraft.client.CameraType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
@ -38,6 +40,7 @@ public class CrossHairOverlay {
public static int HEAD_INDICATOR = 0;
public static int KILL_INDICATOR = 0;
private static float scopeScale = 1f;
public static float gunRot;
@SubscribeEvent(priority = EventPriority.NORMAL)
public static void eventHandler(RenderGuiEvent.Pre event) {
@ -125,10 +128,15 @@ public class CrossHairOverlay {
}
private static void normalCrossHair(GuiGraphics guiGraphics, int w, int h, double spread, float moveX, float moveY) {
PoseStack poseStack = guiGraphics.pose();
poseStack.pushPose();
poseStack.rotateAround(Axis.ZP.rotationDegrees(-gunRot * Mth.RAD_TO_DEG),w / 2f + moveX, h / 2f + moveY, 0);
preciseBlit(guiGraphics, REX_HORIZONTAL, (float) (w / 2f - 13.5f - 2.8f * spread) + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16);
preciseBlit(guiGraphics, REX_HORIZONTAL, (float) (w / 2f - 2.5f + 2.8f * spread) + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16);
preciseBlit(guiGraphics, REX_VERTICAL, w / 2f - 7.5f + moveX, (float) (h / 2f - 2.5f + 2.8f * spread) + moveY, 0, 0, 16, 16, 16, 16);
preciseBlit(guiGraphics, REX_VERTICAL, w / 2f - 7.5f + moveX, (float) (h / 2f - 13.5f - 2.8f * spread) + moveY, 0, 0, 16, 16, 16, 16);
poseStack.popPose();
}
private static void shotgunCrossHair(GuiGraphics guiGraphics, float finPosX, float finPosY, float finLength) {