renderer问题待解决
This commit is contained in:
parent
a3549b09db
commit
0f31cf2ae6
2 changed files with 23 additions and 14 deletions
|
@ -3,12 +3,15 @@ package net.mcreator.superbwarfare.client.renderer.entity;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
import com.mojang.math.Axis;
|
||||||
import net.mcreator.superbwarfare.entity.RgoGrenadeEntity;
|
import net.mcreator.superbwarfare.entity.RgoGrenadeEntity;
|
||||||
import net.mcreator.superbwarfare.entity.model.RgoGrenadeEntityModel;
|
import net.mcreator.superbwarfare.entity.model.RgoGrenadeEntityModel;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||||
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
import software.bernie.geckolib.cache.object.BakedGeoModel;
|
import software.bernie.geckolib.cache.object.BakedGeoModel;
|
||||||
import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
import software.bernie.geckolib.renderer.GeoEntityRenderer;
|
||||||
|
|
||||||
|
@ -32,6 +35,17 @@ public class RgoGrenadeRenderer extends GeoEntityRenderer<RgoGrenadeEntity> {
|
||||||
super.preRender(poseStack, entity, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, red, green, blue, alpha);
|
super.preRender(poseStack, entity, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, red, green, blue, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(RgoGrenadeEntity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int packedLightIn) {
|
||||||
|
VertexConsumer vb = bufferIn.getBuffer(RenderType.eyes(this.getTextureLocation(entityIn)));
|
||||||
|
poseStack.pushPose();
|
||||||
|
poseStack.mulPose(Axis.YP.rotationDegrees(Mth.lerp(partialTicks, entityIn.yRotO, entityIn.getYRot()) - 90));
|
||||||
|
poseStack.mulPose(Axis.ZP.rotationDegrees(90 + Mth.lerp(partialTicks, entityIn.xRotO, entityIn.getXRot())));
|
||||||
|
model.renderToBuffer(poseStack, vb, packedLightIn, OverlayTexture.NO_OVERLAY, 1, 1, 1, 0.0625f);
|
||||||
|
poseStack.popPose();
|
||||||
|
super.render(entityIn, entityYaw, partialTicks, poseStack, bufferIn, packedLightIn);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getDeathMaxRotation(RgoGrenadeEntity entityLivingBaseIn) {
|
protected float getDeathMaxRotation(RgoGrenadeEntity entityLivingBaseIn) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
|
|
|
@ -12,17 +12,12 @@
|
||||||
},
|
},
|
||||||
"bones": [
|
"bones": [
|
||||||
{
|
{
|
||||||
"name": "bone",
|
"name": "group2",
|
||||||
"pivot": [0, 0, 0]
|
"pivot": [0, 1.31719, 0]
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "body",
|
|
||||||
"parent": "bone",
|
|
||||||
"pivot": [0, 1.81719, 0]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bone2",
|
"name": "bone2",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [0, 1.30938, -25.72809],
|
"pivot": [0, 1.30938, -25.72809],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
@ -85,7 +80,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bone3",
|
"name": "bone3",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [0, 1.30938, -25.72809],
|
"pivot": [0, 1.30938, -25.72809],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
@ -164,7 +159,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bone175",
|
"name": "bone175",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [0, 1.30938, -25.72809],
|
"pivot": [0, 1.30938, -25.72809],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
@ -212,7 +207,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "group3",
|
"name": "group3",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [1, 1.96562, 0.14623],
|
"pivot": [1, 1.96562, 0.14623],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
@ -310,7 +305,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "group4",
|
"name": "group4",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [0, 4.20969, 0],
|
"pivot": [0, 4.20969, 0],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
@ -355,7 +350,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "group5",
|
"name": "group5",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [0, 4.20969, 0],
|
"pivot": [0, 4.20969, 0],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
@ -406,7 +401,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "group",
|
"name": "group",
|
||||||
"parent": "body",
|
"parent": "group2",
|
||||||
"pivot": [0, 4.38969, 0],
|
"pivot": [0, 4.38969, 0],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue