调整音量,重制AA12动画

This commit is contained in:
Atsuihsio 2024-06-04 17:35:01 +08:00
parent f2140b03d9
commit 6fc1c2eea2
194 changed files with 2157 additions and 1747 deletions

View file

@ -4,6 +4,7 @@ import net.mcreator.target.item.gun.Aa12Item;
import net.mcreator.target.network.TargetModVariables; 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.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import software.bernie.geckolib.core.animatable.model.CoreGeoBone; import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
@ -39,11 +40,11 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
double zp = 0; double zp = 0;
zp = player.getPersistentData().getDouble("zoom_pos_z"); zp = player.getPersistentData().getDouble("zoom_pos_z");
gun.setPosX(8.863f * (float) p); gun.setPosX(3.48f * (float) p);
gun.setPosY(-0.88f * (float) p - (float) (1.2f * zp)); gun.setPosY(-0.92f * (float) p - (float) (0.2f * zp));
gun.setPosZ((float) p + (float) (3.3f * zp)); gun.setPosZ(0.1f * (float) p + (float) (0.3f * zp));
gun.setRotZ((float) (0.02f * zp)); gun.setRotZ((float) (0.02f * zp));
@ -54,7 +55,7 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
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.02f * (float) (fp + 2 * fr)); shen.setPosY(0.02f * (float) (fp + 2 * fr));
shen.setPosZ(5f * (float) (fp + 0.54f * fr)); shen.setPosZ(1.3f * (float) (fp + 0.54f * fr));
shen.setRotX(0.003f * (float) (fp + fr)); shen.setRotX(0.003f * (float) (fp + fr));
shen.setRotZ(0f); shen.setRotZ(0f);
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) {
@ -64,7 +65,7 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
} }
} else { } else {
shen.setPosY(0.08f * (float) (fp + 2 * fr)); shen.setPosY(0.08f * (float) (fp + 2 * fr));
shen.setPosZ(6f * (float) (fp + 0.54f * fr)); shen.setPosZ(1.6f * (float) (fp + 0.54f * fr));
shen.setRotX(0.07f * (float) (0.18f * fp + fr)); shen.setRotX(0.07f * (float) (0.18f * fp + fr));
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr)); shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
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) {
@ -98,7 +99,7 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
root.setPosX(PosX); root.setPosX(PosX);
root.setPosY((float) y + 2.5f * PosY); root.setPosY((float) y + PosY);
root.setRotX((float) x); root.setRotX((float) x);
@ -132,5 +133,13 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
move.setRotZ(3.7f * (float) yaw + 2.7f * (float) m); move.setRotZ(3.7f * (float) yaw + 2.7f * (float) m);
move.setRotY(1.9f * (float) yaw - 1.7f * (float) m); move.setRotY(1.9f * (float) yaw - 1.7f * (float) m);
CoreGeoBone camera = getAnimationProcessor().getBone("camera");
player.getPersistentData().putDouble("camera_rot_x", Mth.RAD_TO_DEG * camera.getRotX());
player.getPersistentData().putDouble("camera_rot_y", Mth.RAD_TO_DEG * camera.getRotY());
player.getPersistentData().putDouble("camera_rot_z", Mth.RAD_TO_DEG * camera.getRotZ());
} }
} }

View file

@ -91,11 +91,11 @@ public class Aa12Item extends GunItem implements GeoItem, AnimatedItem {
} }
if (stack.getOrCreateTag().getBoolean("reloading") && stack.getOrCreateTag().getBoolean("empty_reload")) { if (stack.getOrCreateTag().getBoolean("reloading") && stack.getOrCreateTag().getBoolean("empty_reload")) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.aa12.reloadempty")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.aa12.reload_empty"));
} }
if (stack.getOrCreateTag().getBoolean("reloading") && !stack.getOrCreateTag().getBoolean("empty_reload")) { if (stack.getOrCreateTag().getBoolean("reloading") && !stack.getOrCreateTag().getBoolean("empty_reload")) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.aa12.reload")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.aa12.reload_normal"));
} }
if (stack.getOrCreateTag().getInt("fire_mode") == 0 && stack.getOrCreateTag().getDouble("cg") > 0) { if (stack.getOrCreateTag().getInt("fire_mode") == 0 && stack.getOrCreateTag().getDouble("cg") > 0) {
@ -183,7 +183,7 @@ public class Aa12Item extends GunItem implements GeoItem, AnimatedItem {
tag.putDouble("reload_time", 0); tag.putDouble("reload_time", 0);
} }
if (tag.getBoolean("reloading") && tag.getInt("ammo") == 0) { if (tag.getBoolean("reloading") && tag.getInt("ammo") == 0) {
if (tag.getDouble("reload_time") == 55) { if (tag.getDouble("reload_time") == 82) {
entity.getPersistentData().putDouble("id", id); entity.getPersistentData().putDouble("id", id);
if (entity instanceof ServerPlayer serverPlayer) { if (entity instanceof ServerPlayer serverPlayer) {
SoundTool.playLocalSound(serverPlayer, TargetModSounds.AA_12_RELOAD_EMPTY.get(), 100, 1); SoundTool.playLocalSound(serverPlayer, TargetModSounds.AA_12_RELOAD_EMPTY.get(), 100, 1);
@ -203,7 +203,7 @@ public class Aa12Item extends GunItem implements GeoItem, AnimatedItem {
GunsTool.reload(entity, GunInfo.Type.SHOTGUN); GunsTool.reload(entity, GunInfo.Type.SHOTGUN);
} }
} else if (tag.getBoolean("reloading") && tag.getInt("ammo") > 0) { } else if (tag.getBoolean("reloading") && tag.getInt("ammo") > 0) {
if (tag.getDouble("reload_time") == 44) { if (tag.getDouble("reload_time") == 61) {
entity.getPersistentData().putDouble("id", id); entity.getPersistentData().putDouble("id", id);
if (entity instanceof ServerPlayer serverPlayer) { if (entity instanceof ServerPlayer serverPlayer) {
SoundTool.playLocalSound(serverPlayer, TargetModSounds.AA_12_RELOAD_NORMAL.get(), 100, 1); SoundTool.playLocalSound(serverPlayer, TargetModSounds.AA_12_RELOAD_NORMAL.get(), 100, 1);

View file

@ -213,12 +213,12 @@ public class PlayerReloadProcedure {
tag.putBoolean("reloading", true); tag.putBoolean("reloading", true);
tag.putBoolean("empty_reload", false); tag.putBoolean("empty_reload", false);
tag.putDouble("id", (Mth.nextDouble(RandomSource.create(), 1, 1919810))); tag.putDouble("id", (Mth.nextDouble(RandomSource.create(), 1, 1919810)));
tag.putDouble("reload_time", 44); tag.putDouble("reload_time", 61);
} else if (tag.getInt("ammo") == 0) { } else if (tag.getInt("ammo") == 0) {
tag.putBoolean("reloading", true); tag.putBoolean("reloading", true);
tag.putDouble("empty_reload", 1); tag.putDouble("empty_reload", 1);
tag.putDouble("id", (Mth.nextDouble(RandomSource.create(), 1, 1919810))); tag.putDouble("id", (Mth.nextDouble(RandomSource.create(), 1, 1919810)));
tag.putDouble("reload_time", 55); tag.putDouble("reload_time", 82);
} }
} }
if (player.getMainHandItem().getItem() == TargetModItems.DEVOTION.get() if (player.getMainHandItem().getItem() == TargetModItems.DEVOTION.get()

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2,15 +2,15 @@
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"parent": "builtin/entity", "parent": "builtin/entity",
"texture_size": [ "texture_size": [
200, 256,
200 256
], ],
"display": { "display": {
"firstperson_righthand": { "firstperson_righthand": {
"translation": [ "translation": [
8.75, -2,
-61, -4.75,
-21 -9.25
], ],
"scale": [ "scale": [
2, 2,
@ -29,6 +29,23 @@
0, 0,
0 0
] ]
},
"gui": {
"rotation": [
165.69,
-39.63,
178.66
],
"translation": [
-2.4,
-4.75,
0
],
"scale": [
0.21,
0.21,
0.21
]
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show more