修复手臂渲染问题,修复物品模型加载问题
This commit is contained in:
parent
d2dc2c2aeb
commit
254cdf32b2
3 changed files with 20 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
package com.atsuishio.superbwarfare.client;
|
||||
|
||||
import com.atsuishio.superbwarfare.Mod;
|
||||
import com.atsuishio.superbwarfare.client.renderer.CustomGunRenderer;
|
||||
import com.atsuishio.superbwarfare.client.renderer.ModRenderTypes;
|
||||
import com.atsuishio.superbwarfare.data.gun.GunData;
|
||||
import com.atsuishio.superbwarfare.data.gun.value.AttachmentType;
|
||||
|
@ -18,6 +19,7 @@ import net.minecraft.client.renderer.entity.player.PlayerRenderer;
|
|||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.PlayerModelPart;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.joml.Matrix4f;
|
||||
|
@ -189,7 +191,14 @@ public class AnimationHelper {
|
|||
RenderUtil.translateAwayFromPivotPoint(stack, bone);
|
||||
ResourceLocation loc = localPlayer.getSkin().texture();
|
||||
if (name.equals("Lefthand")) {
|
||||
stack.translate(-1.0f * SCALE_RECIPROCAL, 2.0f * SCALE_RECIPROCAL, 0.0f);
|
||||
if (!model.leftArm.visible) {
|
||||
model.leftArm.visible = true;
|
||||
}
|
||||
if (!model.leftSleeve.visible && mc.options.isModelPartEnabled(PlayerModelPart.LEFT_SLEEVE)) {
|
||||
model.leftSleeve.visible = true;
|
||||
}
|
||||
|
||||
stack.translate(-1.0f * CustomGunRenderer.SCALE_RECIPROCAL, 2.0f * CustomGunRenderer.SCALE_RECIPROCAL, 0.0f);
|
||||
if (useOldHandRender) {
|
||||
AnimationHelper.renderPartOverBone(model.leftArm, bone, stack, currentBuffer.getBuffer(RenderType.entitySolid(loc)), packedLightIn, OverlayTexture.NO_OVERLAY);
|
||||
AnimationHelper.renderPartOverBone(model.leftSleeve, bone, stack, currentBuffer.getBuffer(RenderType.entityTranslucent(loc)), packedLightIn, OverlayTexture.NO_OVERLAY);
|
||||
|
@ -198,7 +207,14 @@ public class AnimationHelper {
|
|||
AnimationHelper.renderPartOverBone2(model.leftSleeve, bone, stack, currentBuffer.getBuffer(RenderType.entityTranslucent(loc)), packedLightIn, OverlayTexture.NO_OVERLAY);
|
||||
}
|
||||
} else {
|
||||
stack.translate(SCALE_RECIPROCAL, 2.0f * SCALE_RECIPROCAL, 0.0f);
|
||||
if (!model.rightArm.visible) {
|
||||
model.rightArm.visible = true;
|
||||
}
|
||||
if (!model.rightSleeve.visible && mc.options.isModelPartEnabled(PlayerModelPart.RIGHT_SLEEVE)) {
|
||||
model.rightSleeve.visible = true;
|
||||
}
|
||||
|
||||
stack.translate(CustomGunRenderer.SCALE_RECIPROCAL, 2.0f * CustomGunRenderer.SCALE_RECIPROCAL, 0.0f);
|
||||
if (useOldHandRender) {
|
||||
AnimationHelper.renderPartOverBoneR(model.leftArm, bone, stack, currentBuffer.getBuffer(RenderType.entitySolid(loc)), packedLightIn, OverlayTexture.NO_OVERLAY);
|
||||
AnimationHelper.renderPartOverBoneR(model.leftSleeve, bone, stack, currentBuffer.getBuffer(RenderType.entityTranslucent(loc)), packedLightIn, OverlayTexture.NO_OVERLAY);
|
||||
|
|
|
@ -70,6 +70,6 @@
|
|||
}
|
||||
},
|
||||
"textures": {
|
||||
"particle": "item/homemade_shotgun"
|
||||
"particle": "superbwarfare:item/homemade_shotgun"
|
||||
}
|
||||
}
|
|
@ -109,6 +109,6 @@
|
|||
}
|
||||
},
|
||||
"textures": {
|
||||
"particle": "item/tm_62"
|
||||
"particle": "superbwarfare:item/tm_62"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue