Class ValoriaUtils

java.lang.Object
com.idark.valoria.util.ValoriaUtils

public class ValoriaUtils extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
    Checks if the game was started in IDE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addEffectsTooltip(com.google.common.collect.ImmutableList<net.minecraft.world.effect.MobEffectInstance> effects, List<net.minecraft.network.chat.Component> pTooltips, float pDurationFactor, float chance)
     
    static void
    applyCooldownToItemList(net.minecraft.world.entity.player.Player player, List<net.minecraft.world.item.Item> items, int cooldownTicks)
    Applies a cooldown to item list
    static void
    createEndShapedPortal(int pSize, net.minecraft.world.level.Level pDestination, net.minecraft.core.BlockPos pPos, net.minecraft.world.level.block.state.BlockState pPortal, net.minecraft.world.level.block.state.BlockState pFrame)
     
    static void
    damageLastAttackedMob(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, float pAmount)
     
    static net.minecraft.world.phys.HitResult
    getHitResult(net.minecraft.world.phys.Vec3 from, net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.entity.Entity> filter, net.minecraft.world.phys.Vec3 to, net.minecraft.world.level.Level level)
     
    static float
    getRadius(net.minecraft.world.item.ItemStack stack)
     
    static void
    healNearbyMobs(float pHeal, net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity pHealer, List<net.minecraft.world.entity.LivingEntity> hitEntities, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
     
    static void
    healNearbyTypedMobs(net.minecraft.world.entity.MobCategory pType, Float pHeal, net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity pHealer, List<net.minecraft.world.entity.LivingEntity> hitEntities, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
     
    static void
    homingMovement(double pSpeed, net.minecraft.world.entity.Entity projectile, net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity pOwner, net.minecraft.world.phys.AABB boundingBox)
    Can be used in projectile tick() method.
    static void
    inaccurateHomingMovement(double pSpeed, net.minecraft.world.entity.Entity projectile, net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity pOwner, net.minecraft.world.phys.AABB boundingBox)
    Can be used in projectile tick() method.
    static void
    markNearbyMobs(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, List<net.minecraft.world.entity.LivingEntity> hitEntities, net.minecraft.world.phys.Vec3 pos, float pitchRaw, float yawRaw, float radius)
     
    static void
    radiusHit(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, net.minecraft.core.particles.ParticleOptions type, List<net.minecraft.world.entity.LivingEntity> hitEntities, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
    Performs a circled attack near player
    static void
    spawnParticlesAroundPosition(org.joml.Vector3d pos, float distance, float speed, net.minecraft.world.level.Level level, net.minecraft.core.particles.ParticleOptions options)
    Spawns particles around position
    static void
    spawnParticlesInRadius(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, net.minecraft.core.particles.ParticleOptions type, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
    Spawns particles in radius like in radiusHit
    static void
    spawnParticlesLine(net.minecraft.world.level.Level pLevel, net.minecraft.world.phys.Vec3 pFrom, net.minecraft.world.phys.Vec3 pTo, net.minecraft.core.particles.ParticleOptions pType)
    Spawns particles line
    static void
    spawnParticlesLineToAttackedMob(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, net.minecraft.core.particles.ParticleOptions pType)
    Spawns particles line to attacked mob position
    static void
    spawnParticlesLineToAttackedMobWithCooldown(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, net.minecraft.core.particles.ParticleOptions pType, int pDuration)
    Spawns particles line to attacked mob position
    static void
    spawnParticlesLineToNearbyMobs(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, net.minecraft.core.particles.ParticleOptions pType, List<net.minecraft.world.entity.LivingEntity> hitEntities, net.minecraft.world.phys.Vec3 pos, float pitchRaw, float yawRaw, float radius)
    Spawns particle lines to nearby Mobs
    static void
    spawnParticlesMark(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, List<net.minecraft.world.entity.LivingEntity> hitEntities, net.minecraft.core.particles.ParticleOptions type, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
     

    Methods inherited from class java.lang.Object

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

    • isIDE

      public static boolean isIDE
      Checks if the game was started in IDE
  • Constructor Details

    • ValoriaUtils

      public ValoriaUtils()
  • Method Details

    • createEndShapedPortal

      public static void createEndShapedPortal(int pSize, net.minecraft.world.level.Level pDestination, net.minecraft.core.BlockPos pPos, net.minecraft.world.level.block.state.BlockState pPortal, net.minecraft.world.level.block.state.BlockState pFrame)
      Parameters:
      pSize - Portal Size
      pPortal - Portal State
      pFrame - Portal Frame
    • applyCooldownToItemList

      public static void applyCooldownToItemList(net.minecraft.world.entity.player.Player player, List<net.minecraft.world.item.Item> items, int cooldownTicks)
      Applies a cooldown to item list
      Parameters:
      items - ItemList to apply the cooldown
      cooldownTicks - Time of cooldown
    • getRadius

      public static float getRadius(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - being checked
      Returns:
      0.5 per level if true
      See Also:
    • radiusHit

      public static void radiusHit(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, @Nullable net.minecraft.core.particles.ParticleOptions type, List<net.minecraft.world.entity.LivingEntity> hitEntities, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
      Performs a circled attack near player
      Parameters:
      radius - Attack radius
      type - Particle type used to show radius
      hitEntities - List for damaged entities
      pos - Position
    • homingMovement

      public static void homingMovement(double pSpeed, net.minecraft.world.entity.Entity projectile, net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity pOwner, net.minecraft.world.phys.AABB boundingBox)
      Can be used in projectile tick() method. Projectile will have a homing movement to nearby entity
      Parameters:
      pOwner - Owner of Projectile
      boundingBox - radius example:

      new AABB(projectile.getX() - 3.5, projectile.getY() - 0.5, projectile.getZ() - 3.5, projectile.getX() + 3.5, projectile.getY() + 0.5, projectile.getZ() + 3.5);
      
    • inaccurateHomingMovement

      public static void inaccurateHomingMovement(double pSpeed, net.minecraft.world.entity.Entity projectile, net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity pOwner, net.minecraft.world.phys.AABB boundingBox)
      Can be used in projectile tick() method. Projectile will have a homing movement to nearby entity
      Parameters:
      pOwner - Owner of Projectile
      boundingBox - radius example:

      new AABB(projectile.getX() - 3.5, projectile.getY() - 0.5, projectile.getZ() - 3.5, projectile.getX() + 3.5, projectile.getY() + 0.5, projectile.getZ() + 3.5);
      
    • spawnParticlesInRadius

      public static void spawnParticlesInRadius(net.minecraft.world.level.Level level, @Nullable net.minecraft.world.item.ItemStack stack, net.minecraft.core.particles.ParticleOptions type, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
      Spawns particles in radius like in radiusHit
      Parameters:
      radius - Distance in blocks
      stack - Stack to add radius enchantment levels (can be null)
      type - Particle that will spawn at radius
      pos - Position
      See Also:
    • spawnParticlesMark

      public static void spawnParticlesMark(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, List<net.minecraft.world.entity.LivingEntity> hitEntities, net.minecraft.core.particles.ParticleOptions type, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
      Parameters:
      hitEntities - List for damaged entities
      type - Particle that will appear at marked mobs
      pos - Position
      radius - Distance in blocks
      See Also:
    • spawnParticlesAroundPosition

      public static void spawnParticlesAroundPosition(org.joml.Vector3d pos, float distance, float speed, net.minecraft.world.level.Level level, net.minecraft.core.particles.ParticleOptions options)
      Spawns particles around position
      Parameters:
      distance - Distance in blocks
      options - Particle that will spawn at radius
      speed - Speed of particles
      pos - Position
    • spawnParticlesLineToAttackedMob

      public static void spawnParticlesLineToAttackedMob(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, net.minecraft.core.particles.ParticleOptions pType)
      Spawns particles line to attacked mob position
      Parameters:
      pPlayer - Player pos for calculating Attacked mob and positions
      pType - Particle that will spawn line
    • spawnParticlesLineToAttackedMobWithCooldown

      public static void spawnParticlesLineToAttackedMobWithCooldown(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, net.minecraft.core.particles.ParticleOptions pType, int pDuration)
      Spawns particles line to attacked mob position
      Parameters:
      pPlayer - Player pos for calculating Attacked mob and positions
      pType - Particle that will spawn line
      pDuration - cooldown
      See Also:
    • damageLastAttackedMob

      public static void damageLastAttackedMob(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, float pAmount)
    • spawnParticlesLineToNearbyMobs

      public static void spawnParticlesLineToNearbyMobs(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, net.minecraft.core.particles.ParticleOptions pType, List<net.minecraft.world.entity.LivingEntity> hitEntities, net.minecraft.world.phys.Vec3 pos, float pitchRaw, float yawRaw, float radius)
      Spawns particle lines to nearby Mobs
      Parameters:
      pPlayer - Player for reciving pos from
      pType - Particle type to spawn
      hitEntities - list of Entities
      pos - Position in Vec3
      radius - Radius to spawn
    • markNearbyMobs

      public static void markNearbyMobs(net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.player.Player pPlayer, List<net.minecraft.world.entity.LivingEntity> hitEntities, net.minecraft.world.phys.Vec3 pos, float pitchRaw, float yawRaw, float radius)
      Parameters:
      pPlayer - Player for reciving pos from
      hitEntities - list of Entities
      pos - Position in Vec3
      radius - Radius to check mobs
    • healNearbyTypedMobs

      public static void healNearbyTypedMobs(net.minecraft.world.entity.MobCategory pType, Float pHeal, net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity pHealer, List<net.minecraft.world.entity.LivingEntity> hitEntities, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
      Parameters:
      pType - EntityType to heal
      pHealer - Healer entity
      hitEntities - list of Entities
      pos - Position in Vec3
      radius - Radius to check mobs
    • healNearbyMobs

      public static void healNearbyMobs(float pHeal, net.minecraft.world.level.Level pLevel, net.minecraft.world.entity.LivingEntity pHealer, List<net.minecraft.world.entity.LivingEntity> hitEntities, org.joml.Vector3d pos, float pitchRaw, float yawRaw, float radius)
      Parameters:
      pHealer - Healer entity
      hitEntities - list of Entities
      pos - Position in Vec3
      radius - Radius to check mobs
    • spawnParticlesLine

      public static void spawnParticlesLine(net.minecraft.world.level.Level pLevel, net.minecraft.world.phys.Vec3 pFrom, net.minecraft.world.phys.Vec3 pTo, net.minecraft.core.particles.ParticleOptions pType)
      Spawns particles line
      Parameters:
      pType - Particle that will spawn line
      pFrom - Position From
      pTo - Position To
    • getHitResult

      public static net.minecraft.world.phys.HitResult getHitResult(net.minecraft.world.phys.Vec3 from, net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.entity.Entity> filter, net.minecraft.world.phys.Vec3 to, net.minecraft.world.level.Level level)
      Parameters:
      from - pos from
      entity - entity (projectile, player etc.
      filter - (e) -> true as default
      to - pos to
      level - level
      Returns:
      HitResult
    • addEffectsTooltip

      public static void addEffectsTooltip(com.google.common.collect.ImmutableList<net.minecraft.world.effect.MobEffectInstance> effects, List<net.minecraft.network.chat.Component> pTooltips, float pDurationFactor, float chance)