@Environment(value=CLIENT) public class HeldItemRenderer extends Object
Modifier and Type | Field and Description |
---|---|
private MinecraftClient |
client |
private float |
equipProgressMainHand |
private float |
equipProgressOffHand |
private ItemRenderer |
itemRenderer |
private ItemStack |
mainHand |
private static RenderLayer |
MAP_BACKGROUND |
private static RenderLayer |
MAP_BACKGROUND_CHECKERBOARD |
private ItemStack |
offHand |
private float |
prevEquipProgressMainHand |
private float |
prevEquipProgressOffHand |
private EntityRenderDispatcher |
renderManager |
Constructor and Description |
---|
HeldItemRenderer(MinecraftClient client) |
Modifier and Type | Method and Description |
---|---|
private void |
applyEatOrDrinkTransformation(MatrixStack matrices,
float tickDelta,
Arm arm,
ItemStack stack) |
private void |
applyEquipOffset(MatrixStack matrices,
Arm arm,
float equipProgress) |
private void |
applySwingOffset(MatrixStack matrices,
Arm arm,
float swingProgress) |
private float |
getMapAngle(float tickDelta) |
private void |
renderArm(MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int light,
Arm arm) |
private void |
renderArmHoldingItem(MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int light,
float equipProgress,
float swingProgress,
Arm arm) |
private void |
renderFirstPersonItem(AbstractClientPlayerEntity player,
float tickDelta,
float pitch,
Hand hand,
float swingProgress,
ItemStack item,
float equipProgress,
MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int light) |
private void |
renderFirstPersonMap(MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int swingProgress,
ItemStack stack) |
void |
renderItem(float tickDelta,
MatrixStack matrices,
VertexConsumerProvider.Immediate vertexConsumers,
ClientPlayerEntity player,
int light) |
void |
renderItem(LivingEntity entity,
ItemStack stack,
ModelTransformation.Mode renderMode,
boolean leftHanded,
MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int light) |
private void |
renderMapInBothHands(MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int light,
float pitch,
float equipProgress,
float swingProgress) |
private void |
renderMapInOneHand(MatrixStack matrices,
VertexConsumerProvider vertexConsumers,
int light,
float equipProgress,
Arm arm,
float swingProgress,
ItemStack stack) |
void |
resetEquipProgress(Hand hand) |
void |
updateHeldItems() |
private static final RenderLayer MAP_BACKGROUND
private static final RenderLayer MAP_BACKGROUND_CHECKERBOARD
private final MinecraftClient client
private ItemStack mainHand
private ItemStack offHand
private float equipProgressMainHand
private float prevEquipProgressMainHand
private float equipProgressOffHand
private float prevEquipProgressOffHand
private final EntityRenderDispatcher renderManager
private final ItemRenderer itemRenderer
public HeldItemRenderer(MinecraftClient client)
public void renderItem(LivingEntity entity, ItemStack stack, ModelTransformation.Mode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light)
private float getMapAngle(float tickDelta)
private void renderArm(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, Arm arm)
private void renderMapInOneHand(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float equipProgress, Arm arm, float swingProgress, ItemStack stack)
private void renderMapInBothHands(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float pitch, float equipProgress, float swingProgress)
private void renderFirstPersonMap(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int swingProgress, ItemStack stack)
private void renderArmHoldingItem(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float equipProgress, float swingProgress, Arm arm)
private void applyEatOrDrinkTransformation(MatrixStack matrices, float tickDelta, Arm arm, ItemStack stack)
private void applySwingOffset(MatrixStack matrices, Arm arm, float swingProgress)
private void applyEquipOffset(MatrixStack matrices, Arm arm, float equipProgress)
public void renderItem(float tickDelta, MatrixStack matrices, VertexConsumerProvider.Immediate vertexConsumers, ClientPlayerEntity player, int light)
private void renderFirstPersonItem(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light)
public void updateHeldItems()
public void resetEquipProgress(Hand hand)