50 lines
2.0 KiB
Java
50 lines
2.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* org.joml.Quaternionfc
|
|
*/
|
|
package net.minecraft.client.renderer.entity.layers;
|
|
|
|
import com.mojang.blaze3d.vertex.PoseStack;
|
|
import com.mojang.math.Axis;
|
|
import net.minecraft.client.model.IronGolemModel;
|
|
import net.minecraft.client.model.geom.ModelPart;
|
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
|
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
|
import net.minecraft.client.renderer.entity.RenderLayerParent;
|
|
import net.minecraft.client.renderer.entity.layers.RenderLayer;
|
|
import net.minecraft.client.renderer.entity.state.IronGolemRenderState;
|
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
|
import net.minecraft.world.level.block.Blocks;
|
|
import org.joml.Quaternionfc;
|
|
|
|
public class IronGolemFlowerLayer
|
|
extends RenderLayer<IronGolemRenderState, IronGolemModel> {
|
|
private final BlockRenderDispatcher blockRenderer;
|
|
|
|
public IronGolemFlowerLayer(RenderLayerParent<IronGolemRenderState, IronGolemModel> renderer, BlockRenderDispatcher blockRenderer) {
|
|
super(renderer);
|
|
this.blockRenderer = blockRenderer;
|
|
}
|
|
|
|
@Override
|
|
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, IronGolemRenderState state, float yRot, float xRot) {
|
|
if (state.offerFlowerTick == 0) {
|
|
return;
|
|
}
|
|
poseStack.pushPose();
|
|
ModelPart arm = ((IronGolemModel)this.getParentModel()).getFlowerHoldingArm();
|
|
arm.translateAndRotate(poseStack);
|
|
poseStack.translate(-1.1875f, 1.0625f, -0.9375f);
|
|
poseStack.translate(0.5f, 0.5f, 0.5f);
|
|
float s = 0.5f;
|
|
poseStack.scale(0.5f, 0.5f, 0.5f);
|
|
poseStack.mulPose((Quaternionfc)Axis.XP.rotationDegrees(-90.0f));
|
|
poseStack.translate(-0.5f, -0.5f, -0.5f);
|
|
submitNodeCollector.submitBlock(poseStack, Blocks.POPPY.defaultBlockState(), lightCoords, OverlayTexture.NO_OVERLAY, state.outlineColor);
|
|
poseStack.popPose();
|
|
}
|
|
}
|
|
|