Package com.idark.valoria.util
Class ValoriaUtils
java.lang.Object
com.idark.valoria.util.ValoriaUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 liststatic 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 playerstatic 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 positionstatic 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 radiusHitstatic 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 linestatic 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 positionstatic 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 positionstatic 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 Mobsstatic 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)
-
Field Details
-
isIDE
public static boolean isIDEChecks 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 SizepPortal
- Portal StatepFrame
- 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 cooldowncooldownTicks
- 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 radiustype
- Particle type used to show radiushitEntities
- List for damaged entitiespos
- 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 ProjectileboundingBox
- 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 ProjectileboundingBox
- 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 blocksstack
- Stack to add radius enchantment levels (can be null)type
- Particle that will spawn at radiuspos
- 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 entitiestype
- Particle that will appear at marked mobspos
- Positionradius
- 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 blocksoptions
- Particle that will spawn at radiusspeed
- Speed of particlespos
- 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 positionspType
- 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 positionspType
- Particle that will spawn linepDuration
- 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 frompType
- Particle type to spawnhitEntities
- list of Entitiespos
- Position in Vec3radius
- 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 fromhitEntities
- list of Entitiespos
- Position in Vec3radius
- 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 healpHealer
- Healer entityhitEntities
- list of Entitiespos
- Position in Vec3radius
- 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 entityhitEntities
- list of Entitiespos
- Position in Vec3radius
- 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 linepFrom
- Position FrompTo
- 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 fromentity
- entity (projectile, player etc.filter
- (e) -> true as defaultto
- pos tolevel
- 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)
-