去营业妨碍化VECTOR,重制短剑动画,优化曳光弹

This commit is contained in:
Atsuihsio 2024-06-14 19:40:18 +08:00
parent 89a1c71d9c
commit ac1cb2d2d6
18 changed files with 9176 additions and 7349 deletions

View file

@ -26,9 +26,17 @@ public class ModelBullet<T extends Entity> extends EntityModel<T> {
public static LayerDefinition createBodyLayer() { public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition(); MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot(); PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition bone = partdefinition.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(0.0F, 8.0F, 0.0F)); PartDefinition bone = partdefinition.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(0.0F, 8.0F, 0.0F));
PartDefinition bone2 = bone.addOrReplaceChild("bone2", CubeListBuilder.create(), PartPose.offset(-2.1213F, 8.5F, 0.0F));
PartDefinition cube_r1 = bone2.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(1, 1).addBox(-1.5F, -21.5F, -1.5F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.7854F, 0.0F)); PartDefinition bone2 = bone.addOrReplaceChild("bone2", CubeListBuilder.create().texOffs(0, 0).addBox(-1.4142F, -92.5F, -1.2071F, 0.0F, 15.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-2.1213F, 8.5F, 0.0F));
PartDefinition cube_r1 = bone2.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5F, 0.0F, -0.5F, 1.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.4142F, -92.1F, -0.7071F, 0.0F, 0.7854F, 0.0F));
PartDefinition cube_r2 = bone2.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(0, 0).addBox(0.0F, -7.5F, -0.5F, 0.0F, 15.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.4142F, -85.0F, -0.7071F, 0.0F, -2.0944F, 0.0F));
PartDefinition cube_r3 = bone2.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 0).addBox(0.0F, -7.5F, -0.5F, 0.0F, 15.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.4142F, -85.0F, -0.7071F, 0.0F, -1.0472F, 0.0F));
return LayerDefinition.create(meshdefinition, 16, 16); return LayerDefinition.create(meshdefinition, 16, 16);
} }

View file

@ -40,17 +40,15 @@ public class VectorItemModel extends GeoModel<VectorItem> {
double zp = 0; double zp = 0;
zp = player.getPersistentData().getDouble("zoom_pos_z"); zp = player.getPersistentData().getDouble("zoom_pos_z");
gun.setPosX(2.62f * (float) p); gun.setPosX(2.35f * (float) p);
gun.setPosY(0.9f * (float) p - (float) (0.6f * zp)); gun.setPosY(0.74f * (float) p - (float) (0.2f * zp));
gun.setPosZ(3f * (float) p + (float) (0.5f * zp)); gun.setPosZ(5f * (float) p + (float) (0.3f * zp));
gun.setRotZ(-0.087f * (float) p + (float) (0.05f * zp));
gun.setScaleZ(1f - (0.5f * (float) p)); gun.setScaleZ(1f - (0.5f * (float) p));
scope.setScaleZ(1f - (0.6f * (float) p)); scope.setScaleZ(1f - (0.2f * (float) p));
float fps = Minecraft.getInstance().getFps(); float fps = Minecraft.getInstance().getFps();
if (fps <= 0) { if (fps <= 0) {
@ -59,12 +57,10 @@ public class VectorItemModel extends GeoModel<VectorItem> {
float times = 250f / fps; float times = 250f / fps;
CoreGeoBone holo = getAnimationProcessor().getBone("holo"); CoreGeoBone holo = getAnimationProcessor().getBone("holo");
if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming && gun.getPosX() > 2.45) { if ((player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).zooming && gun.getPosX() > 2) {
holo.setScaleX(1); holo.setHidden(false);
holo.setScaleY(1);
} else { } else {
holo.setScaleX(0); holo.setHidden(true);
holo.setScaleY(0);
} }
double fp = player.getPersistentData().getDouble("fire_pos"); double fp = player.getPersistentData().getDouble("fire_pos");
@ -135,5 +131,13 @@ public class VectorItemModel extends GeoModel<VectorItem> {
move.setRotY(0.7f * Mth.DEG_TO_RAD * (float) yRot); move.setRotY(0.7f * Mth.DEG_TO_RAD * (float) yRot);
move.setRotZ(2.7f * (float) m + Mth.DEG_TO_RAD * (float) zRot); move.setRotZ(2.7f * (float) m + Mth.DEG_TO_RAD * (float) zRot);
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

@ -16,6 +16,7 @@ import net.minecraft.util.Mth;
public class ProjectileRenderer extends EntityRenderer<ProjectileEntity> { public class ProjectileRenderer extends EntityRenderer<ProjectileEntity> {
private static final ResourceLocation texture = new ResourceLocation("target:textures/entity/bullet_tex.png"); private static final ResourceLocation texture = new ResourceLocation("target:textures/entity/bullet_tex.png");
private static final ResourceLocation empty_texture = new ResourceLocation("target:textures/entity/empty.png");
private final ModelBullet<ProjectileEntity> model; private final ModelBullet<ProjectileEntity> model;
public ProjectileRenderer(EntityRendererProvider.Context context) { public ProjectileRenderer(EntityRendererProvider.Context context) {
@ -40,6 +41,9 @@ public class ProjectileRenderer extends EntityRenderer<ProjectileEntity> {
@Override @Override
public ResourceLocation getTextureLocation(ProjectileEntity entity) { public ResourceLocation getTextureLocation(ProjectileEntity entity) {
if (entity.tickCount > 1){
return texture; return texture;
} }
return empty_texture;
}
} }

View file

@ -133,11 +133,11 @@ public class VectorItem 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.vec.reload")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.vec.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.vec.reload2")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.vec.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) {
@ -227,7 +227,7 @@ public class VectorItem extends GunItem implements GeoItem, AnimatedItem {
GunsTool.reload(entity, GunInfo.Type.HANDGUN); GunsTool.reload(entity, GunInfo.Type.HANDGUN);
} }
} else if (tag.getBoolean("reloading") && tag.getInt("ammo") > 0) { } else if (tag.getBoolean("reloading") && tag.getInt("ammo") > 0) {
if (tag.getDouble("reload_time") == 47) { if (tag.getDouble("reload_time") == 43) {
entity.getPersistentData().putDouble("id", id); entity.getPersistentData().putDouble("id", id);
if (entity instanceof ServerPlayer serverPlayer) { if (entity instanceof ServerPlayer serverPlayer) {
serverPlayer.connection.send(new ClientboundSoundPacket(new Holder.Direct<>(ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("target:vector_reload_normal"))), serverPlayer.connection.send(new ClientboundSoundPacket(new Holder.Direct<>(ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("target:vector_reload_normal"))),

View file

@ -127,7 +127,7 @@ 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", 47); tag.putDouble("reload_time", 43);
} 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);

File diff suppressed because it is too large Load diff

View file

@ -38,6 +38,11 @@
-5.75, -5.75,
4.25, 4.25,
2 2
],
"scale": [
0,
0,
0
] ]
}, },
"gui": { "gui": {

View file

@ -31,20 +31,15 @@
] ]
}, },
"firstperson_righthand": { "firstperson_righthand": {
"rotation": [
0,
0,
5
],
"translation": [ "translation": [
1.75, -4.25,
-19, -2.75,
-24.25 -8
], ],
"scale": [ "scale": [
4, 2,
4, 2,
4 2
] ]
}, },
"firstperson_lefthand": { "firstperson_lefthand": {
@ -71,9 +66,9 @@
0 0
], ],
"scale": [ "scale": [
0, 0.55,
0, 0.55,
0 0.55
] ]
}, },
"gui": { "gui": {
@ -83,8 +78,8 @@
0 0
], ],
"translation": [ "translation": [
-0.25, -1,
-0.5, 0.25,
0 0
], ],
"scale": [ "scale": [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

@ -1,12 +1,12 @@
{ {
"zoom_speed": 1.6, "zoom_speed": 1.6,
"zoom": 1.25, "zoom": 1.25,
"dev": 3.5, "dev": 2.3,
"recoil_x": 0.007, "recoil_x": 0.007,
"recoil_y": 0.007, "recoil_y": 0.007,
"damage": 4.5, "damage": 4.5,
"headshot": 1.5, "headshot": 1.5,
"velocity": 14, "velocity": 16,
"mag": 33, "mag": 33,
"projectile_amount": 1, "projectile_amount": 1,
"fire_interval": 1, "fire_interval": 1,