重置猎木仓

This commit is contained in:
Atsuishio 2025-06-07 15:19:01 +08:00 committed by Light_Quanta
parent 77a452df81
commit fb8f8a4a3a
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
9 changed files with 2833 additions and 2171 deletions

View file

@ -30,6 +30,16 @@ public class HuntingRifleItemModel extends CustomGunModel<HuntingRifleItem> {
return Mod.loc("textures/item/hunting_rifle.png");
}
@Override
public ResourceLocation getLODModelResource(HuntingRifleItem animatable) {
return Mod.loc("geo/lod/hunting_rifle.geo.json");
}
@Override
public ResourceLocation getLODTextureResource(HuntingRifleItem animatable) {
return Mod.loc("textures/item/lod/hunting_rifle.png");
}
@Override
public void setCustomAnimations(HuntingRifleItem animatable, long instanceId, AnimationState<HuntingRifleItem> animationState) {
Player player = Minecraft.getInstance().player;
@ -38,7 +48,7 @@ public class HuntingRifleItemModel extends CustomGunModel<HuntingRifleItem> {
if (shouldCancelRender(stack, animationState)) return;
GeoBone gun = getAnimationProcessor().getBone("bone");
GeoBone shen = getAnimationProcessor().getBone("lieqiang");
GeoBone fireRoot = getAnimationProcessor().getBone("fireRoot");
float times = 0.6f * (float) Math.min(Minecraft.getInstance().getTimer().getRealtimeDeltaTicks(), 0.8);
double zt = ClientEventHandler.zoomTime;
@ -49,31 +59,27 @@ public class HuntingRifleItemModel extends CustomGunModel<HuntingRifleItem> {
double fp = ClientEventHandler.firePos;
double fr = ClientEventHandler.fireRot;
gun.setPosX(1.95f * (float) zp);
gun.setPosY(1.32f * (float) zp - (float) (0.2f * zpz));
gun.setPosZ(3f * (float) zp + (float) (0.5f * zpz));
gun.setPosX(1.975f * (float) zp);
gun.setPosY(1.2f * (float) zp - (float) (0.2f * zpz));
gun.setPosZ(4f * (float) zp + (float) (0.5f * zpz));
gun.setRotZ((float) (0.05f * zpz));
gun.setScaleZ(1f - (0.5f * (float) zp));
shen.setPosX((float) (0.95f * ClientEventHandler.recoilHorizon * fpz * fp));
shen.setPosY((float) (0.4f * fp + 0.44f * fr));
shen.setPosZ((float) (2.825 * fp + 0.17f * fr + 1.175 * fpz));
shen.setRotX((float) (0.01f * fp + 0.2f * fr + 0.01f * fpz));
shen.setRotY((float) (0.1f * ClientEventHandler.recoilHorizon * fpz));
shen.setRotZ((float) ((0.08f + 0.1 * fr) * ClientEventHandler.recoilHorizon));
fireRoot.setPosX((float) (0.95f * ClientEventHandler.recoilHorizon * fpz * fp));
fireRoot.setPosY((float) (0.4f * fp + 0.44f * fr));
fireRoot.setPosZ((float) (2.825 * fp + 0.17f * fr + 1.175 * fpz));
fireRoot.setRotX((float) (0.01f * fp + 0.2f * fr + 0.01f * fpz));
fireRoot.setRotY((float) (0.1f * ClientEventHandler.recoilHorizon * fpz));
fireRoot.setRotZ((float) ((0.08f + 0.1 * fr) * ClientEventHandler.recoilHorizon));
shen.setPosX((float) (shen.getPosX() * (1 - 0.4 * zt)));
shen.setPosY((float) (shen.getPosY() * (1 - 0.5 * zt)));
shen.setPosZ((float) (shen.getPosZ() * (1 - 0.7 * zt)));
shen.setRotX((float) (shen.getRotX() * (1 - 0.87 * zt)));
shen.setRotY((float) (shen.getRotY() * (1 - 0.7 * zt)));
shen.setRotZ((float) (shen.getRotZ() * (1 - 0.65 * zt)));
fireRoot.setPosX((float) (fireRoot.getPosX() * (1 - 0.4 * zt)));
fireRoot.setPosY((float) (fireRoot.getPosY() * (1 - 0.5 * zt)));
fireRoot.setPosZ((float) (fireRoot.getPosZ() * (1 - 0.7 * zt)));
fireRoot.setRotX((float) (fireRoot.getRotX() * (1 - 0.87 * zt)));
fireRoot.setRotY((float) (fireRoot.getRotY() * (1 - 0.7 * zt)));
fireRoot.setRotZ((float) (fireRoot.getRotZ() * (1 - 0.65 * zt)));
CrossHairOverlay.gunRot = shen.getRotZ();
CrossHairOverlay.gunRot = fireRoot.getRotZ();
ClientEventHandler.gunRootMove(getAnimationProcessor());

View file

@ -10,6 +10,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import software.bernie.geckolib.animatable.GeoItem;
import software.bernie.geckolib.cache.object.GeoBone;
@ -36,11 +37,13 @@ public class HuntingRifleItemRenderer extends CustomGunRenderer<HuntingRifleItem
if (player == null) return;
ItemStack itemStack = player.getMainHandItem();
if (itemStack.getItem() instanceof GunItem && GeoItem.getId(itemStack) == this.getInstanceId(animatable)) {
AnimationHelper.handleShootFlare(name, stack, itemStack, bone, buffer, packedLightIn, 0, 0, 2.234375, 0.6);
if (this.renderPerspective == ItemDisplayContext.FIRST_PERSON_RIGHT_HAND || this.renderPerspective == ItemDisplayContext.THIRD_PERSON_RIGHT_HAND) {
AnimationHelper.handleShootFlare(name, stack, itemStack, bone, buffer, packedLightIn, 0, 0, 2.234375, 0.6);
}
}
if (renderingArms) {
AnimationHelper.renderArms(player, this.renderPerspective, stack, name, bone, buffer, type, packedLightIn, true);
AnimationHelper.renderArms(player, this.renderPerspective, stack, name, bone, buffer, type, packedLightIn, false);
}
super.renderRecursively(stack, animatable, bone, type, buffer, bufferIn, isReRender, partialTick, packedLightIn, packedOverlayIn, color);
}

View file

@ -133,10 +133,6 @@
"0.525": [0.3, 0, -0.3],
"0.7": [-0.3, -0.3, 0.3]
}
},
"Lefthand": {
"rotation": [-1.41476, -16.33468, -1.66483],
"position": [6, -13, 49]
}
}
},

View file

@ -0,0 +1,145 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.hunting_rifle",
"texture_width": 64,
"texture_height": 64,
"visible_bounds_width": 5,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "group",
"pivot": [0.4824, 0.83126, 4.28265],
"cubes": [
{
"origin": [-0.067, 3.07556, 3.1797],
"size": [1.34, 0.536, 1.943],
"uv": {
"north": {"uv": [22, 20], "uv_size": [1, 1]},
"east": {"uv": [4, 4], "uv_size": [31, 1]},
"south": {"uv": [22, 21], "uv_size": [1, 1]},
"west": {"uv": [4, 5], "uv_size": [31, 1]},
"up": {"uv": [4, 6], "uv_size": [1, 31]},
"down": {"uv": [5, 37], "uv_size": [1, -31]}
}
},
{
"origin": [-0.067, 1.73556, -42.3943],
"size": [1.34, 1.34, 48.455],
"uv": {
"north": {"uv": [22, 20], "uv_size": [1, 1]},
"east": {"uv": [4, 4], "uv_size": [31, 1]},
"south": {"uv": [22, 21], "uv_size": [1, 1]},
"west": {"uv": [4, 5], "uv_size": [31, 1]},
"up": {"uv": [4, 6], "uv_size": [1, 31]},
"down": {"uv": [5, 37], "uv_size": [1, -31]}
}
},
{
"origin": [-0.067, 3.07556, -8.7463],
"size": [1.34, 0.402, 5.427],
"uv": {
"north": {"uv": [22, 20], "uv_size": [1, 1]},
"east": {"uv": [4, 4], "uv_size": [31, 1]},
"south": {"uv": [22, 21], "uv_size": [1, 1]},
"west": {"uv": [4, 5], "uv_size": [31, 1]},
"up": {"uv": [4, 6], "uv_size": [1, 31]},
"down": {"uv": [5, 37], "uv_size": [1, -31]}
}
},
{
"origin": [-1.407, 2.80756, -2.7833],
"size": [1.608, 0.536, 0.536],
"uv": {
"north": {"uv": [22, 22], "uv_size": [1, 1]},
"east": {"uv": [23, 14], "uv_size": [1, 1]},
"south": {"uv": [23, 15], "uv_size": [1, 1]},
"west": {"uv": [23, 20], "uv_size": [1, 1]},
"up": {"uv": [23, 21], "uv_size": [1, 1]},
"down": {"uv": [22, 24], "uv_size": [1, -1]}
}
},
{
"origin": [0.201, 3.07556, -3.3193],
"size": [0.804, 0.268, 8.844],
"uv": {
"north": {"uv": [23, 22], "uv_size": [1, 1]},
"east": {"uv": [23, 23], "uv_size": [1, 1]},
"south": {"uv": [0, 24], "uv_size": [1, 1]},
"west": {"uv": [1, 24], "uv_size": [1, 1]},
"up": {"uv": [2, 24], "uv_size": [1, 1]},
"down": {"uv": [24, 3], "uv_size": [1, -1]}
}
},
{
"origin": [-0.402, 0.06056, -15.0443],
"size": [2.01, 2.68, 21.44],
"uv": {
"north": {"uv": [20, 2], "uv_size": [2, 2]},
"east": {"uv": [0, 0], "uv_size": [16, 2]},
"south": {"uv": [20, 20], "uv_size": [2, 2]},
"west": {"uv": [0, 2], "uv_size": [16, 2]},
"up": {"uv": [0, 4], "uv_size": [2, 16]},
"down": {"uv": [2, 20], "uv_size": [2, -16]}
}
},
{
"origin": [-0.402, -5.92116, 4.67278],
"size": [2.01, 2.68, 16.348],
"pivot": [0.603, -4.58116, 20.57032],
"rotation": [-22.5, 0, 0],
"uv": {
"north": {"uv": [22, 2], "uv_size": [2, 2]},
"east": {"uv": [6, 6], "uv_size": [12, 2]},
"south": {"uv": [6, 22], "uv_size": [2, 2]},
"west": {"uv": [6, 8], "uv_size": [12, 2]},
"up": {"uv": [6, 10], "uv_size": [2, 12]},
"down": {"uv": [8, 22], "uv_size": [2, -12]}
}
},
{
"origin": [-0.402, -1.49842, 9.9057],
"size": [2.01, 2.68, 11.725],
"uv": {
"north": {"uv": [22, 6], "uv_size": [2, 2]},
"east": {"uv": [14, 14], "uv_size": [9, 2]},
"south": {"uv": [8, 22], "uv_size": [2, 2]},
"west": {"uv": [16, 0], "uv_size": [9, 2]},
"up": {"uv": [14, 16], "uv_size": [2, 9]},
"down": {"uv": [16, 25], "uv_size": [2, -9]}
}
},
{
"origin": [-0.402, -3.91042, 15.9357],
"size": [2.01, 5.092, 5.695],
"uv": {
"north": {"uv": [0, 20], "uv_size": [2, 4]},
"east": {"uv": [18, 6], "uv_size": [4, 4]},
"south": {"uv": [2, 20], "uv_size": [2, 4]},
"west": {"uv": [18, 16], "uv_size": [4, 4]},
"up": {"uv": [20, 10], "uv_size": [2, 4]},
"down": {"uv": [18, 24], "uv_size": [2, -4]}
}
},
{
"origin": [-0.402, -6.59042, 19.6207],
"size": [2.01, 2.68, 2.01],
"uv": {
"north": {"uv": [22, 8], "uv_size": [2, 2]},
"east": {"uv": [22, 10], "uv_size": [2, 2]},
"south": {"uv": [22, 12], "uv_size": [2, 2]},
"west": {"uv": [22, 16], "uv_size": [2, 2]},
"up": {"uv": [22, 18], "uv_size": [2, 2]},
"down": {"uv": [20, 24], "uv_size": [2, -2]}
}
}
]
}
]
}
]
}

View file

@ -25,21 +25,59 @@
0
]
},
"gui": {
"thirdperson_righthand": {
"translation": [
-0.75,
-1.25,
-1.25
],
"scale": [
0.6,
0.6,
0.6
]
},
"thirdperson_lefthand": {
"scale": [
0,
0,
0
]
},
"ground": {
"translation": [
0,
1.5,
4.5
],
"scale": [
0.6,
0.6,
0.6
]
},
"head": {
"translation": [
0,
6.25,
1.5
]
},
"fixed": {
"rotation": [
165.69,
-39.63,
178.66
0,
-90,
0
],
"translation": [
-1,
-0.75,
-7.5,
-0.5,
0
],
"scale": [
0.35,
0.35,
0.35
1.25,
1.25,
1.25
]
}
}

View file

@ -1,169 +0,0 @@
{
"credit": "Made with Blockbench",
"texture_size": [64, 64],
"textures": {
"0": "superbwarfare:item/lod/hunting_rifle",
"particle": "superbwarfare:item/lod/hunting_rifle"
},
"elements": [
{
"from": [7.5, 7, 16.6],
"to": [8.5, 7.4, 18.05],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
"faces": {
"north": {"uv": [5.5, 5, 5.75, 5.25], "texture": "#0"},
"east": {"uv": [1, 1, 8.75, 1.25], "texture": "#0"},
"south": {"uv": [5.5, 5.25, 5.75, 5.5], "texture": "#0"},
"west": {"uv": [1, 1.25, 8.75, 1.5], "texture": "#0"},
"up": {"uv": [1.25, 9.25, 1, 1.5], "texture": "#0"},
"down": {"uv": [1.5, 1.5, 1.25, 9.25], "texture": "#0"}
}
},
{
"from": [7.5, 6, -12],
"to": [8.5, 7, 18.75],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
"faces": {
"north": {"uv": [5.5, 5, 5.75, 5.25], "texture": "#0"},
"east": {"uv": [1, 1, 8.75, 1.25], "texture": "#0"},
"south": {"uv": [5.5, 5.25, 5.75, 5.5], "texture": "#0"},
"west": {"uv": [1, 1.25, 8.75, 1.5], "texture": "#0"},
"up": {"uv": [1.25, 9.25, 1, 1.5], "texture": "#0"},
"down": {"uv": [1.5, 1.5, 1.25, 9.25], "texture": "#0"}
}
},
{
"from": [7.5, 7, 7.7],
"to": [8.5, 7.3, 11.75],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
"faces": {
"north": {"uv": [5.5, 5, 5.75, 5.25], "texture": "#0"},
"east": {"uv": [1, 1, 8.75, 1.25], "texture": "#0"},
"south": {"uv": [5.5, 5.25, 5.75, 5.5], "texture": "#0"},
"west": {"uv": [1, 1.25, 8.75, 1.5], "texture": "#0"},
"up": {"uv": [1.25, 9.25, 1, 1.5], "texture": "#0"},
"down": {"uv": [1.5, 1.5, 1.25, 9.25], "texture": "#0"}
}
},
{
"from": [8.3, 6.8, 12.15],
"to": [9.5, 7.2, 12.55],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, -3.6]},
"faces": {
"north": {"uv": [5.5, 5.5, 5.75, 5.75], "texture": "#0"},
"east": {"uv": [5.75, 3.5, 6, 3.75], "texture": "#0"},
"south": {"uv": [5.75, 3.75, 6, 4], "texture": "#0"},
"west": {"uv": [5.75, 5, 6, 5.25], "texture": "#0"},
"up": {"uv": [6, 5.5, 5.75, 5.25], "texture": "#0"},
"down": {"uv": [5.75, 5.75, 5.5, 6], "texture": "#0"}
}
},
{
"from": [7.7, 7, 11.75],
"to": [8.3, 7.2, 18.35],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 4]},
"faces": {
"north": {"uv": [5.75, 5.5, 6, 5.75], "texture": "#0"},
"east": {"uv": [5.75, 5.75, 6, 6], "texture": "#0"},
"south": {"uv": [0, 6, 0.25, 6.25], "texture": "#0"},
"west": {"uv": [0.25, 6, 0.5, 6.25], "texture": "#0"},
"up": {"uv": [0.75, 6.25, 0.5, 6], "texture": "#0"},
"down": {"uv": [6.25, 0.5, 6, 0.75], "texture": "#0"}
}
},
{
"from": [7.25, 4.75, 3],
"to": [8.75, 6.75, 19],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
"faces": {
"north": {"uv": [5, 0.5, 5.5, 1], "texture": "#0"},
"east": {"uv": [0, 0, 4, 0.5], "texture": "#0"},
"south": {"uv": [5, 5, 5.5, 5.5], "texture": "#0"},
"west": {"uv": [0, 0.5, 4, 1], "texture": "#0"},
"up": {"uv": [0.5, 5, 0, 1], "texture": "#0"},
"down": {"uv": [1, 1, 0.5, 5], "texture": "#0"}
}
},
{
"from": [7.25, 0.28603, 17.71424],
"to": [8.75, 2.28603, 29.91424],
"rotation": {"angle": 22.5, "axis": "x", "origin": [8, 1.28603, 29.57807]},
"faces": {
"north": {"uv": [5.5, 0.5, 6, 1], "texture": "#0"},
"east": {"uv": [1.5, 1.5, 4.5, 2], "texture": "#0"},
"south": {"uv": [1.5, 5.5, 2, 6], "texture": "#0"},
"west": {"uv": [1.5, 2, 4.5, 2.5], "texture": "#0"},
"up": {"uv": [2, 5.5, 1.5, 2.5], "texture": "#0"},
"down": {"uv": [2.5, 2.5, 2, 5.5], "texture": "#0"}
}
},
{
"from": [7.25, 3.58658, 21.6194],
"to": [8.75, 5.58658, 30.3694],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 3.83658, 35.48323]},
"faces": {
"north": {"uv": [5.5, 1.5, 6, 2], "texture": "#0"},
"east": {"uv": [3.5, 3.5, 5.75, 4], "texture": "#0"},
"south": {"uv": [2, 5.5, 2.5, 6], "texture": "#0"},
"west": {"uv": [4, 0, 6.25, 0.5], "texture": "#0"},
"up": {"uv": [4, 6.25, 3.5, 4], "texture": "#0"},
"down": {"uv": [4.5, 4, 4, 6.25], "texture": "#0"}
}
},
{
"from": [7.25, 1.78658, 26.1194],
"to": [8.75, 5.58658, 30.3694],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 3.83658, 35.48323]},
"faces": {
"north": {"uv": [0, 5, 0.5, 6], "texture": "#0"},
"east": {"uv": [4.5, 1.5, 5.5, 2.5], "texture": "#0"},
"south": {"uv": [0.5, 5, 1, 6], "texture": "#0"},
"west": {"uv": [4.5, 4, 5.5, 5], "texture": "#0"},
"up": {"uv": [5.5, 3.5, 5, 2.5], "texture": "#0"},
"down": {"uv": [5, 5, 4.5, 6], "texture": "#0"}
}
},
{
"from": [7.25, -0.21342, 28.8694],
"to": [8.75, 1.78658, 30.3694],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 3.83658, 35.48323]},
"faces": {
"north": {"uv": [5.5, 2, 6, 2.5], "texture": "#0"},
"east": {"uv": [5.5, 2.5, 6, 3], "texture": "#0"},
"south": {"uv": [5.5, 3, 6, 3.5], "texture": "#0"},
"west": {"uv": [5.5, 4, 6, 4.5], "texture": "#0"},
"up": {"uv": [6, 5, 5.5, 4.5], "texture": "#0"},
"down": {"uv": [5.5, 5.5, 5, 6], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [-0.75, 2.5, -7.5],
"scale": [0.7, 0.7, 0.7]
},
"thirdperson_lefthand": {
"translation": [-0.75, 2.5, -7.5],
"scale": [0, 0, 0]
},
"ground": {
"translation": [0, 1.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"head": {
"translation": [0, 9.75, -4.25]
},
"fixed": {
"rotation": [0, -90, 0],
"translation": [3.5, 2.25, 0]
}
},
"groups": [
{
"name": "group",
"origin": [8, 3.83658, 35.48323],
"color": 0,
"children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB