Class SpiritSize

java.lang.Object
etithespirit.orimod.spirit.SpiritSize

public final class SpiritSize extends Object
All code pertaining to spirit size and collision modifications. This executes with the help of a mixin.
Author:
Eti
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.world.entity.EntityDimensions
    The size of a player who is sneaking.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a player flying with an Elytra.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a player who SPEEN (I don't actually know what this pose is lol)
    static final net.minecraft.world.entity.EntityDimensions
    The size of a standing player.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a player who is swimming.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a spirit who is sneaking.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a spirit flying with an Elytra.
    static final Map<net.minecraft.world.entity.Pose,net.minecraft.world.entity.EntityDimensions>
    A lookup from Pose to EntityDimensions for spirits.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a spirit who SPEEN
    static final net.minecraft.world.entity.EntityDimensions
    The size of a standing spirit.
    static final net.minecraft.world.entity.EntityDimensions
    The size of a spirit who is swimming.
    static final float
    A spirit's width relative to that of a player's width.
    static final float
    A spirit's height relative to that of a player's height.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.phys.AABB
    atWithSize(net.minecraft.world.phys.Vec3 at, net.minecraft.world.entity.EntityDimensions size)
    Returns a new AABB at the given location centered within the given size.
    static net.minecraft.world.entity.EntityDimensions
    getSpiritSizeFrom(net.minecraft.world.entity.Pose pose)
    Given a pose, this returns the Spirit playermodel size associated with it.
    static boolean
    isPoseClear(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.EntityDimensions entSize)
    Returns true if the world does not collide with the given entity size located at the given player.
    static void
    onGetEntitySizeCommon(net.minecraftforge.event.entity.EntityEvent.Size event)
    Occurs when an entity's size is tested.
    static void
    onPlayerTickedCommon(net.minecraftforge.event.TickEvent.PlayerTickEvent evt)
     

    Methods inherited from class java.lang.Object

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

    • X_SCALE

      public static final float X_SCALE
      A spirit's width relative to that of a player's width.
      See Also:
    • Y_SCALE

      public static final float Y_SCALE
      A spirit's height relative to that of a player's height.
      See Also:
    • PLAYER_STANDING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions PLAYER_STANDING_SIZE
      The size of a standing player.
    • PLAYER_FALL_FLYING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions PLAYER_FALL_FLYING_SIZE
      The size of a player flying with an Elytra.
    • PLAYER_SWIMMING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions PLAYER_SWIMMING_SIZE
      The size of a player who is swimming.
    • PLAYER_SPIN_ATTACK_SIZE

      public static final net.minecraft.world.entity.EntityDimensions PLAYER_SPIN_ATTACK_SIZE
      The size of a player who SPEEN (I don't actually know what this pose is lol)
    • PLAYER_CROUCHING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions PLAYER_CROUCHING_SIZE
      The size of a player who is sneaking.
    • SPIRIT_STANDING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions SPIRIT_STANDING_SIZE
      The size of a standing spirit.
    • SPIRIT_FALL_FLYING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions SPIRIT_FALL_FLYING_SIZE
      The size of a spirit flying with an Elytra.
    • SPIRIT_SWIMMING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions SPIRIT_SWIMMING_SIZE
      The size of a spirit who is swimming.
    • SPIRIT_SPIN_ATTACK_SIZE

      public static final net.minecraft.world.entity.EntityDimensions SPIRIT_SPIN_ATTACK_SIZE
      The size of a spirit who SPEEN
    • SPIRIT_CROUCHING_SIZE

      public static final net.minecraft.world.entity.EntityDimensions SPIRIT_CROUCHING_SIZE
      The size of a spirit who is sneaking.
    • SPIRIT_SIZE_BY_POSE

      public static final Map<net.minecraft.world.entity.Pose,net.minecraft.world.entity.EntityDimensions> SPIRIT_SIZE_BY_POSE
      A lookup from Pose to EntityDimensions for spirits. Binds to the static final EntityDimensions instances in this class.
  • Constructor Details

    • SpiritSize

      public SpiritSize()
  • Method Details

    • onGetEntitySizeCommon

      public static void onGetEntitySizeCommon(net.minecraftforge.event.entity.EntityEvent.Size event)
      Occurs when an entity's size is tested.
      Parameters:
      event - The event. Obviously. I'm only writing this here so IntelliJ doesn't throw a fit.
    • atWithSize

      public static net.minecraft.world.phys.AABB atWithSize(net.minecraft.world.phys.Vec3 at, net.minecraft.world.entity.EntityDimensions size)
      Returns a new AABB at the given location centered within the given size.
      Parameters:
      at - The location of the center of the axis-aligned bounding box.
      size - The size of this bounding box.
      Returns:
      An AABB located around at with size size.
    • isPoseClear

      public static boolean isPoseClear(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.EntityDimensions entSize)
      Returns true if the world does not collide with the given entity size located at the given player.
      Parameters:
      player - The player to test.
      entSize - The size of the player.
      Returns:
      Whether or not that player is intersecting any blocks in the world.
    • getSpiritSizeFrom

      @Nullable public static net.minecraft.world.entity.EntityDimensions getSpiritSizeFrom(net.minecraft.world.entity.Pose pose)
      Given a pose, this returns the Spirit playermodel size associated with it.
      Parameters:
      pose - The pose to use for reference.
      Returns:
      An EntityDimensions suited for this pose.
    • onPlayerTickedCommon

      public static void onPlayerTickedCommon(net.minecraftforge.event.TickEvent.PlayerTickEvent evt)