Class Flattener

java.lang.Object
com.mrbysco.flatterentities.Flattener

public class Flattener extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>>
     
    static boolean
     
    static final List<net.minecraft.world.entity.EntityType<?>>
     
    static final Map<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>, List<net.minecraft.world.entity.EntityType<?>>>
     
    static boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends net.minecraft.world.entity.LivingEntity>
    float
    getYawRotation(T entityIn, float partialTicks, boolean shouldSit)
    Calculates the yaw rotation angle for an entity's rendering, considering its body and head rotations.
    static void
    prepareFlatRendering(float rotation, double x, double z, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.entity.state.EntityRenderState renderState)
    Prepares the rendering of an entity in a flat style based on certain conditions.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • renderingEnabled

      public static boolean renderingEnabled
    • entityBlacklist

      public static final List<net.minecraft.world.entity.EntityType<?>> entityBlacklist
    • entityDimensionWhitelist

      public static final Map<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>, List<net.minecraft.world.entity.EntityType<?>>> entityDimensionWhitelist
    • dimensionBlacklist

      public static final List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> dimensionBlacklist
    • dimensionListIsWhitelist

      public static boolean dimensionListIsWhitelist
  • Constructor Details

    • Flattener

      public Flattener()
  • Method Details

    • prepareFlatRendering

      public static void prepareFlatRendering(float rotation, double x, double z, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.entity.state.EntityRenderState renderState)
      Prepares the rendering of an entity in a flat style based on certain conditions. This method adjusts the pose stack to achieve the desired flat rendering effect for the entity.
      Parameters:
      rotation - The yaw rotation angle of the entity, in degrees. This angle is often the result of linearly interpolating between the entity's previous and current yaw rotations using Mth.rotLerp(partialTicks, renderState.yRotO, renderState.getYRot()).
      x - The X-coordinate of the entity's position.
      z - The Z-coordinate of the entity's position.
      poseStack - The PoseStack used for rendering transformations.
      renderState - The entity to be rendered.
    • getYawRotation

      public static <T extends net.minecraft.world.entity.LivingEntity> float getYawRotation(T entityIn, float partialTicks, boolean shouldSit)
      Calculates the yaw rotation angle for an entity's rendering, considering its body and head rotations.
      Type Parameters:
      T - A subtype of LivingEntity.
      Parameters:
      entityIn - The living entity for which to calculate the rotation angle.
      partialTicks - The partial tick value used for smooth rotation interpolation.
      shouldSit - A boolean indicating whether the entity is sitting.
      Returns:
      The calculated yaw rotation angle for the entity's rendering.