优化开火动画
This commit is contained in:
parent
45752ec95c
commit
312919daea
25 changed files with 485 additions and 330 deletions
|
@ -76,23 +76,28 @@ public class AK47ItemModel extends GeoModel<AK47Item> {
|
||||||
}
|
}
|
||||||
|
|
||||||
double 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) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
shen.setPosY(0.01f * (float) fp);
|
shen.setPosY(-0.01f * (float) (fp + 2 * fr));
|
||||||
shen.setPosZ(0.4f * (float) fp);
|
shen.setPosZ(0.2f * (float) (fp + 0.54f * fr));
|
||||||
shen.setRotX(0.003f * (float) fp);
|
shen.setRotX(0.003f * (float) (fp + 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) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
shen.setRotY(0.003f * (float) fp);
|
shen.setRotY(0.015f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotY(-0.003f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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);
|
shuan.setPosZ(2.4f * (float) fp);
|
||||||
|
|
|
@ -49,25 +49,28 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
|
||||||
|
|
||||||
gun.setScaleZ(1f - (0.4f * (float) p));
|
gun.setScaleZ(1f - (0.4f * (float) p));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
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) {
|
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 {
|
} else {
|
||||||
shen.setPosZ(6f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
|
||||||
shen.setRotX(0.03f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setRotX(0.06f * (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);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -49,17 +49,28 @@ public class AbekiriItemModel extends GeoModel<Abekiri> {
|
||||||
|
|
||||||
gun.setRotZ((float) (0.05f * zp));
|
gun.setRotZ((float) (0.05f * zp));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(4f * (float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
shen.setPosY(0.04f * (float) (fp + 2 * fr));
|
||||||
shen.setRotX(0.08f * (float) fp);
|
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 == 1) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
shen.setRotY(0.04f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (float) fp);
|
shen.setRotY(-0.04f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -112,17 +112,28 @@ public class BocekItemModel extends GeoModel<BocekItem> {
|
||||||
double FirePosZ = 0;
|
double FirePosZ = 0;
|
||||||
double FireRotX = 0;
|
double FireRotX = 0;
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
fire.setPosZ(4f * (float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
fire.setPosY(-0.01f * (float) (fp + 2 * fr));
|
||||||
fire.setRotX(0.02f * (float) fp);
|
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 == 1) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
fire.setRotZ(0.003f * (float) fp);
|
fire.setRotY(0.015f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
fire.setRotZ(-0.003f * (float) fp);
|
fire.setRotY(-0.015f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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");
|
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||||
|
|
|
@ -57,30 +57,33 @@ public class DevotionItemModel extends GeoModel<Devotion> {
|
||||||
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||||
CoreGeoBone number = getAnimationProcessor().getBone("number");
|
CoreGeoBone number = getAnimationProcessor().getBone("number");
|
||||||
|
|
||||||
double fp = 0;
|
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
|
||||||
|
|
||||||
double bp = 0;
|
double bp = 0;
|
||||||
bp = player.getPersistentData().getDouble("boltpos");
|
bp = player.getPersistentData().getDouble("boltpos");
|
||||||
|
|
||||||
bolt.setPosZ(-2f * (float) bp);
|
bolt.setPosZ(-2f * (float) bp);
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
shen.setPosZ(0.4f * (float) fp);
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
} else {
|
|
||||||
shen.setPosZ(0.75f * (float) fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.002f * (float) fp);
|
|
||||||
} else {
|
} 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");
|
CoreGeoBone holo = getAnimationProcessor().getBone("holo");
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class Hk416ItemModel extends GeoModel<Hk416Item> {
|
||||||
|
|
||||||
gun.setPosY(1.04f * (float) p - (float) (0.2f * zp));
|
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));
|
gun.setRotZ((float) (0.05f * zp));
|
||||||
|
|
||||||
|
@ -73,21 +73,28 @@ public class Hk416ItemModel extends GeoModel<Hk416Item> {
|
||||||
holo.setScaleY(0);
|
holo.setScaleY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(0.8f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
|
||||||
} else {
|
} 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");
|
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||||
|
|
|
@ -50,23 +50,28 @@ public class HuntingRifleItemModel extends GeoModel<HuntingRifle> {
|
||||||
|
|
||||||
gun.setScaleZ(1f - (0.1f * (float) p));
|
gun.setScaleZ(1f - (0.1f * (float) p));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(4f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setPosY((float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
shen.setRotX(0.1f * (float) fp);
|
|
||||||
|
|
||||||
if (Math.random() < 0.5) {
|
|
||||||
shen.setRotZ(0.005f * (float) fp);
|
|
||||||
} else {
|
} 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");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -43,27 +43,28 @@ public class KraberItemModel extends GeoModel<Kraber> {
|
||||||
r.setRotX(-1.5f);
|
r.setRotX(-1.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
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) {
|
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 {
|
} else {
|
||||||
shen.setPosZ(4f * (float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
|
||||||
shen.setPosY(0.5f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setPosY((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);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double p = 0;
|
double p = 0;
|
||||||
|
|
|
@ -45,27 +45,34 @@ public class M4ItemModel extends GeoModel<M4Item> {
|
||||||
|
|
||||||
gun.setPosY(0.65f * (float) p - (float) (0.2f * zp));
|
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.setScaleZ(1f - (0.2f * (float) p));
|
||||||
|
|
||||||
gun.setRotZ((float) (0.05f * zp));
|
gun.setRotZ((float) (0.05f * zp));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(0.85f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
|
||||||
} else {
|
} 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");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -91,23 +91,28 @@ public class M60ItemModel extends GeoModel<M60Item> {
|
||||||
|
|
||||||
gun.setRotZ(-0.087f * (float) p + (float) (0.05f * zp));
|
gun.setRotZ(-0.087f * (float) p + (float) (0.05f * zp));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(1.25f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (float) fp);
|
shen.setPosY(-0.03f * (float) (fp + 2 * fr));
|
||||||
tiba.setRotZ(-0.25f * (float) fp);
|
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");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -61,17 +61,28 @@ public class M79ItemModel extends GeoModel<M79Item> {
|
||||||
flare.setRotZ(0);
|
flare.setRotZ(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(4f * (float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
shen.setPosY(0.4f * (float) (fp + 2 * fr));
|
||||||
shen.setRotX(0.1f * (float) fp);
|
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 == 1) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
shen.setRotY(0.025f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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");
|
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||||
|
|
|
@ -61,31 +61,28 @@ public class M870ItemModel extends GeoModel<M870Item> {
|
||||||
|
|
||||||
gun.setScaleZ(1f - (0.2f * (float) p));
|
gun.setScaleZ(1f - (0.2f * (float) p));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
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) {
|
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 {
|
} else {
|
||||||
shen.setPosZ(4f * (float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
|
||||||
shen.setPosY(0.01f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setPosY((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);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -35,25 +35,28 @@ public class M98bItemModel extends GeoModel<M98bItem> {
|
||||||
Player player = Minecraft.getInstance().player;
|
Player player = Minecraft.getInstance().player;
|
||||||
ItemStack stack = player.getMainHandItem();
|
ItemStack stack = player.getMainHandItem();
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(3f * (float) fp);
|
|
||||||
|
|
||||||
shi.setPosZ(60f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setPosY(0.5f * (float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
} 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;
|
double p = 0;
|
||||||
|
|
|
@ -52,31 +52,28 @@ public class MarlinItemModel extends GeoModel<MarlinItem> {
|
||||||
|
|
||||||
gun.setScaleZ(1f - (0.2f * (float) p));
|
gun.setScaleZ(1f - (0.2f * (float) p));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
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) {
|
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 {
|
} else {
|
||||||
shen.setPosZ(2f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
|
||||||
shen.setPosY(0.01f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setPosY((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);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -45,17 +45,28 @@ public class MinigunItemModel extends GeoModel<Minigun> {
|
||||||
gun.setRotZ((float) (gun.getRotZ() + times * -0.008f * stack.getOrCreateTag().getDouble("minigun_rotation")));
|
gun.setRotZ((float) (gun.getRotZ() + times * -0.008f * stack.getOrCreateTag().getDouble("minigun_rotation")));
|
||||||
|
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ((float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
shen.setPosY(0.02f * (float) (fp + 2 * fr));
|
||||||
shen.setRotX(0.02f * (float) fp);
|
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 == 1) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
shen.setRotY(0.015f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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) {
|
if (stack.getOrCreateTag().getInt("fire_animation") > 0) {
|
||||||
|
|
|
@ -65,23 +65,28 @@ public class Mk14ItemModel extends GeoModel<Mk14Item> {
|
||||||
|
|
||||||
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(3f * (float) fp);
|
|
||||||
|
|
||||||
shuan.setPosZ(6f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
|
||||||
} else {
|
} 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) {
|
if (gun.getPosX() > 5.5f) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.mcreator.target.client.model.item;
|
package net.mcreator.target.client.model.item;
|
||||||
|
|
||||||
import net.mcreator.target.item.gun.RpgItem;
|
import net.mcreator.target.item.gun.RpgItem;
|
||||||
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
|
@ -41,17 +42,28 @@ public class RpgItemModel extends GeoModel<RpgItem> {
|
||||||
rocket.setScaleZ(0);
|
rocket.setScaleZ(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ((float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
shen.setPosY(0.02f * (float) (fp + 2 * fr));
|
||||||
shen.setRotX(0.05f * (float) fp);
|
shen.setPosZ(1.6f * (float) (fp + 0.54f * fr));
|
||||||
|
shen.setRotX(0.003f * (float) (fp + fr));
|
||||||
if (Math.random() < 0.5) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
shen.setRotZ(0.01f * (float) fp);
|
shen.setRotY(0.015f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.01f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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;
|
double p = 0;
|
||||||
|
|
|
@ -48,9 +48,9 @@ public class RpkItemModel extends GeoModel<RpkItem> {
|
||||||
|
|
||||||
gun.setPosX(1.69f * (float) p);
|
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));
|
gun.setRotZ((float) (0.05f * zp));
|
||||||
|
|
||||||
|
@ -82,24 +82,29 @@ public class RpkItemModel extends GeoModel<RpkItem> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ((float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shuan.setPosZ(2.4f * (float) fp);
|
|
||||||
|
|
||||||
if (stack.getOrCreateTag().getDouble("flash_time") > 0) {
|
if (stack.getOrCreateTag().getDouble("flash_time") > 0) {
|
||||||
flare.setScaleX((float) (1.0 + 0.5 * (Math.random() - 0.5)));
|
flare.setScaleX((float) (1.0 + 0.5 * (Math.random() - 0.5)));
|
||||||
|
|
|
@ -77,27 +77,28 @@ public class SentinelItemModel extends GeoModel<SentinelItem> {
|
||||||
holo.setScaleY(0);
|
holo.setScaleY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
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) {
|
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 {
|
} else {
|
||||||
shen.setPosZ(5f * (float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
|
||||||
shen.setPosY(0.3f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setPosY(1.3f * (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);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreGeoBone charge = getAnimationProcessor().getBone("charge");
|
CoreGeoBone charge = getAnimationProcessor().getBone("charge");
|
||||||
|
|
|
@ -67,21 +67,28 @@ public class SksItemModel extends GeoModel<SksItem> {
|
||||||
|
|
||||||
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ((float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
|
||||||
} else {
|
} 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);
|
shuan.setPosZ(2.5f * (float) fp);
|
||||||
|
|
|
@ -90,30 +90,29 @@ public class SvdItemModel extends GeoModel<SvdItem> {
|
||||||
|
|
||||||
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(1.8f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setPosY(0.2f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
|
||||||
shen.setRotX(0.002f * (float) fp);
|
|
||||||
} else {
|
} else {
|
||||||
shen.setRotX(0.08f * (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));
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
|
shen.setRotY(0.03f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (float) fp);
|
shen.setRotY(-0.03f * (float) fr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shuan.setPosZ(2.4f * (float) fp);
|
|
||||||
|
|
||||||
holo.setPosY(1.1f * (float) fp);
|
holo.setPosY(1.1f * (float) fp);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.mcreator.target.client.model.item;
|
package net.mcreator.target.client.model.item;
|
||||||
|
|
||||||
import net.mcreator.target.item.gun.Taser;
|
import net.mcreator.target.item.gun.Taser;
|
||||||
|
import net.mcreator.target.network.TargetModVariables;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
@ -31,12 +32,29 @@ public class TaserItemModel extends GeoModel<Taser> {
|
||||||
|
|
||||||
Player player = Minecraft.getInstance().player;
|
Player player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(0.75f * (float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
shen.setPosY(0.02f * (float) (fp + 2 * fr));
|
||||||
shen.setRotX(0.02f * (float) fp);
|
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;
|
double p = 0;
|
||||||
p = player.getPersistentData().getDouble("zoom_pos");
|
p = player.getPersistentData().getDouble("zoom_pos");
|
||||||
|
|
|
@ -50,17 +50,28 @@ public class TracheliumItemModel extends GeoModel<Trachelium> {
|
||||||
|
|
||||||
gun.setScaleZ(1f - (0.2f * (float) p));
|
gun.setScaleZ(1f - (0.2f * (float) p));
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(4f * (float) fp);
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
|
shen.setPosY(0.4f * (float) (fp + 2 * fr));
|
||||||
shen.setRotX(0.2f * (float) fp);
|
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 == 1) {
|
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon > 0) {
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
shen.setRotY(0.025f * (float) fr);
|
||||||
} else {
|
} else {
|
||||||
shen.setRotZ(-0.003f * (float) fp);
|
shen.setRotY(-0.025f * (float) fr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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");
|
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||||
|
|
|
@ -66,21 +66,28 @@ public class VectorItemModel extends GeoModel<VectorItem> {
|
||||||
holo.setScaleY(0);
|
holo.setScaleY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
double fp = 0;
|
double fp = player.getPersistentData().getDouble("fire_pos");
|
||||||
fp = player.getPersistentData().getDouble("fire_pos");
|
double fr = player.getPersistentData().getDouble("fire_rot");
|
||||||
|
|
||||||
shen.setPosZ(0.75f * (float) fp);
|
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
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 {
|
} else {
|
||||||
shen.setRotX(0.02f * (float) fp);
|
shen.setRotY(-0.015f * (float) fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).recoilHorizon == 1) {
|
|
||||||
shen.setRotZ(0.003f * (float) fp);
|
|
||||||
} else {
|
} 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");
|
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||||
|
|
|
@ -342,13 +342,13 @@ public class ClientEventHandler {
|
||||||
if ((entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
if ((entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming) {
|
||||||
if (data.getDouble("zoom_time") < 1) {
|
if (data.getDouble("zoom_time") < 1) {
|
||||||
data.putDouble("zoom_time",
|
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 {
|
} else {
|
||||||
data.putDouble("zoom_time", 1);
|
data.putDouble("zoom_time", 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data.getDouble("zoom_time") > 0) {
|
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 {
|
} else {
|
||||||
data.putDouble("zoom_time", 0);
|
data.putDouble("zoom_time", 0);
|
||||||
}
|
}
|
||||||
|
@ -390,6 +390,7 @@ public class ClientEventHandler {
|
||||||
var capability = entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null);
|
var capability = entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null);
|
||||||
if (capability.orElse(new TargetModVariables.PlayerVariables()).firing > 0) {
|
if (capability.orElse(new TargetModVariables.PlayerVariables()).firing > 0) {
|
||||||
data.putDouble("firetime", 0.2);
|
data.putDouble("firetime", 0.2);
|
||||||
|
data.putDouble("fire_rotx_time", 0.2);
|
||||||
if (0.3 > data.getDouble("firepos2")) {
|
if (0.3 > data.getDouble("firepos2")) {
|
||||||
data.putDouble("firepos2", (data.getDouble("firepos2") + 0.04 * times));
|
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))));
|
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) {
|
if (0 <= data.getDouble("firetime") && data.getDouble("firetime") <= 0.25) {
|
||||||
data.putDouble("boltpos", (-Math.pow(8 * data.getDouble("firetime") - 1, 2) + 1));
|
data.putDouble("boltpos", (-Math.pow(8 * data.getDouble("firetime") - 1, 2) + 1));
|
||||||
}
|
}
|
||||||
|
@ -437,6 +447,9 @@ public class ClientEventHandler {
|
||||||
if (data.getDouble("firetime") >= 1) {
|
if (data.getDouble("firetime") >= 1) {
|
||||||
data.putDouble("firetime", 0);
|
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) {
|
private static void handleShockCamera(ViewportEvent.ComputeCameraAngles event, LivingEntity entity) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue