完成95的配件适配

This commit is contained in:
Atsuihsio 2024-11-12 18:36:45 +08:00
parent a88bbb6161
commit e2fc0eb701
16 changed files with 10769 additions and 2602 deletions

View file

@ -4,4 +4,4 @@ org.gradle.daemon=false
mc_version=1.20.1
jei_version=15.2.0.27
cloth_config_version=11.1.106
mod_version=0.2.2
mod_version=0.2.3

View file

@ -76,7 +76,7 @@ public class AK12ItemModel extends GeoModel<AK12Item> {
float posY = switch (type) {
case 0 -> 0.781f;
case 1 -> 0.371f;
case 2 -> -0.04f;
case 2 -> -0.021f;
case 3 -> -0.01f;
default -> 0f;
};

View file

@ -55,6 +55,9 @@ public class M4ItemModel extends GeoModel<M4Item> {
CoreGeoBone crossAlt = getAnimationProcessor().getBone("CrossAlt");
CoreGeoBone sight1fold = getAnimationProcessor().getBone("sight1fold");
CoreGeoBone sight2fold = getAnimationProcessor().getBone("sight2fold");
CoreGeoBone button = getAnimationProcessor().getBone("button");
CoreGeoBone button6 = getAnimationProcessor().getBone("button6");
CoreGeoBone button7 = getAnimationProcessor().getBone("button7");
Player player = Minecraft.getInstance().player;
if (player == null) return;
@ -120,6 +123,10 @@ public class M4ItemModel extends GeoModel<M4Item> {
scope2.setScaleZ(1f - (0.4f * (float) zp));
scope3.setScaleZ(1f + (0.2f * (float) zp));
button.setScaleY(1f - (0.85f * (float) zp));
button6.setScaleX(1f - (0.5f * (float) zp));
button7.setScaleX(1f - (0.5f * (float) zp));
stack.getOrCreateTag().putBoolean("HoloHidden", !(gun.getPosX() > 2.385));
if (type == 3 && zt > 0.5) {

View file

@ -41,12 +41,12 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
public void setCustomAnimations(Qbz95Item animatable, long instanceId, AnimationState animationState) {
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
CoreGeoBone bolt = getAnimationProcessor().getBone("bolt2");
CoreGeoBone scope = getAnimationProcessor().getBone("Scope1");
// CoreGeoBone scope2 = getAnimationProcessor().getBone("Scope2");
// CoreGeoBone scope3 = getAnimationProcessor().getBone("Scope3");
CoreGeoBone button = getAnimationProcessor().getBone("button");
CoreGeoBone button3 = getAnimationProcessor().getBone("button3");
CoreGeoBone button6 = getAnimationProcessor().getBone("button6");
CoreGeoBone cross1 = getAnimationProcessor().getBone("Cross1");
// CoreGeoBone cross2 = getAnimationProcessor().getBone("Cross2");
// CoreGeoBone cross3 = getAnimationProcessor().getBone("Cross3");
CoreGeoBone cross2 = getAnimationProcessor().getBone("Cross2");
CoreGeoBone cross3 = getAnimationProcessor().getBone("Cross3");
CoreGeoBone camera = getAnimationProcessor().getBone("camera");
CoreGeoBone main = getAnimationProcessor().getBone("0");
@ -75,34 +75,45 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
int type = GunsTool.getAttachmentType(stack, GunsTool.AttachmentType.SCOPE);
float posYAlt = switch (type) {
case 2 -> 0.85f;
case 3 -> 0.9f;
default -> 0f;
};
float posY = switch (type) {
case 0 -> 0.535f;
case 1 -> -0.155f;
case 2 -> 0.5001f;
case 3 -> 0.5002f;
case 2 -> -0.975f + posYAlt;
case 3 -> -0.64f + posYAlt;
default -> 0f;
};
float posZ = switch (type) {
case 0 -> 5.9f;
case 1 -> 5.8f;
case 2 -> 13.01f;
case 3 -> 13.00f;
case 2 -> 14.51f;
case 3 -> 17.2f;
default -> 0f;
};
float scaleZ = switch (type) {
case 0 -> 0.2f;
case 1 -> 0.21f;
case 2 -> 0.692f;
case 3 -> 0.691f;
case 2 -> 0.792f;
case 3 -> 0.891f;
default -> 0f;
};
gun.setPosX(3.71f * (float) zp);
gun.setPosY(posY * (float) zp - (float) (0.2f * zpz));
gun.setPosY(posY * (float) zp - (float) (0.2f * zpz) - posYAlt);
gun.setPosZ(posZ * (float) zp + (float) (0.3f * zpz));
gun.setRotZ((float) (0.05f * zpz));
gun.setScaleZ(1f - (scaleZ * (float) zp));
if (main.getRotZ() < 10 * Mth.DEG_TO_RAD) {
button.setScaleY(1f - (0.85f * (float) zp));
button3.setScaleX(1f - (0.5f * (float) zp));
button6.setScaleX(1f - (0.5f * (float) zp));
}
stack.getOrCreateTag().putBoolean("HoloHidden", gun.getPosX() < 3.1 || main.getRotZ() > 10 * Mth.DEG_TO_RAD);
CoreGeoBone shen;
@ -138,8 +149,8 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
bolt.setPosZ(5f * (float) fp);
cross1.setPosY(-0.75f * (float) fpz);
// cross2.setPosY(-0.7f * (float) fpz);
// cross3.setPosY(-0.2f * (float) fpz);
cross2.setPosY(-0.7f * (float) fpz);
cross3.setPosY(-0.2f * (float) fpz);
CoreGeoBone l = getAnimationProcessor().getBone("l");
CoreGeoBone r = getAnimationProcessor().getBone("r");
@ -165,8 +176,19 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
root.setRotY((float) (0.2f * movePosX + Mth.DEG_TO_RAD * 300 * ClientEventHandler.drawTime + Mth.DEG_TO_RAD * turnRotY));
root.setRotZ((float) (0.2f * movePosX + moveRotZ + Mth.DEG_TO_RAD * 90 * ClientEventHandler.drawTime + 2.7f * mph + Mth.DEG_TO_RAD * turnRotZ));
float numR = (float) (1 - 0.88 * zt);
float numP = (float) (1 - 0.95 * zt);
float numR = 1;
float numP = 1;
if (stack.getOrCreateTag().getBoolean("is_empty_reloading")) {
numR = (float) (1 - 0.72 * zt);
numP = (float) (1 - 0.95 * zt);
}
if (stack.getOrCreateTag().getBoolean("is_normal_reloading")) {
numR = (float) (1 - 0.98 * zt);
numP = (float) (1 - 0.96 * zt);
}
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());

View file

@ -104,7 +104,7 @@ public class AK12ItemRenderer extends GeoItemRenderer<AK12Item> {
}
if (GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) == 2
&& (name.equals("hidden"))) {
&& (name.equals("hidden2"))) {
bone.setHidden(!itemStack.getOrCreateTag().getBoolean("HoloHidden") && GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS);
}

View file

@ -104,27 +104,27 @@ public class Qbz95ItemRenderer extends GeoItemRenderer<Qbz95Item> {
bone.setHidden(GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.GRIP) == 0);
}
// if (name.equals("Cross2")) {
// bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden")
// || GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) != GLFW.GLFW_PRESS
// || GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) != 2);
// }
//
// if (name.equals("Cross3")) {
// bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden")
// || GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) != GLFW.GLFW_PRESS
// || GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) != 3);
// }
if (name.equals("Cross2")) {
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden")
|| GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) != GLFW.GLFW_PRESS
|| GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) != 2);
}
// if (GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) == 2
// && (name.equals("hidden"))) {
// bone.setHidden(!itemStack.getOrCreateTag().getBoolean("HoloHidden") && GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS);
// }
//
// if (GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) == 3
// && (name.equals("jing") || name.equals("Barrel") || name.equals("yugu") || name.equals("qiangguan"))) {
// bone.setHidden(!itemStack.getOrCreateTag().getBoolean("HoloHidden") && GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS);
// }
if (name.equals("Cross3")) {
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden")
|| GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) != GLFW.GLFW_PRESS
|| GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) != 3);
}
if (GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) == 2
&& (name.equals("hidden"))) {
bone.setHidden(!itemStack.getOrCreateTag().getBoolean("HoloHidden") && GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS);
}
if (GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.SCOPE) == 3
&& (name.equals("hidden2") || name.equals("jimiao2"))) {
bone.setHidden(!itemStack.getOrCreateTag().getBoolean("HoloHidden") && GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS);
}
if (name.equals("flare")) {
if (ClientEventHandler.firePosTimer == 0 || ClientEventHandler.firePosTimer > 0.5 || GunsTool.getAttachmentType(itemStack, GunsTool.AttachmentType.BARREL) == 2) {

View file

@ -177,7 +177,7 @@ public class Qbz95Item extends GunItem implements GeoItem, AnimatedItem {
double customZoom = switch (scopeType) {
case 0, 1 -> 0;
case 2 -> 1.75;
case 2 -> 2.15;
default -> stack.getOrCreateTag().getDouble("CustomZoom");
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -1,6 +1,6 @@
{
"MinZoom": 1.25,
"MaxZoom": 6,
"MinZoom": 4,
"MaxZoom": 8,
"spread": 3.7,
"recoil_x": 0.0013,
"recoil_y": 0.009,
@ -15,7 +15,7 @@
"burst": 0,
"auto": 1,
"burst_size": 1,
"normal_reload_time": 58,
"normal_reload_time": 60,
"EmptyReloadTime": 74,
"BypassesArmor": 0.28,
"SoundRadius": 13,