Package org.rusherhack.client.api.utils
Class WorldUtils
java.lang.Object
org.rusherhack.client.api.utils.WorldUtils
- All Implemented Interfaces:
Globals
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkCollision
(net.minecraft.core.BlockPos pos) static boolean
checkCollision
(net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.VoxelShape shape, Predicate<net.minecraft.world.entity.Entity> predicate) static List<net.minecraft.world.level.block.entity.BlockEntity>
getBlockEntities
(boolean sorted) static List<net.minecraft.world.level.chunk.LevelChunk>
static List<net.minecraft.core.BlockPos>
getCircle
(net.minecraft.core.Vec3i center, float circleRadius) static List<net.minecraft.world.entity.Entity>
static List<net.minecraft.world.entity.Entity>
getEntities
(Predicate<net.minecraft.world.entity.Entity> predicate) static List<net.minecraft.world.entity.Entity>
static List<net.minecraft.world.entity.Entity>
getEntitiesSorted
(net.minecraft.world.entity.Entity entity) static List<net.minecraft.world.entity.Entity>
getEntitiesSorted
(net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.entity.Entity> predicate) static List<net.minecraft.core.BlockPos>
getSphere
(net.minecraft.core.Vec3i center, float sphereRadius) static List<net.minecraft.core.BlockPos>
getSphere
(net.minecraft.core.Vec3i center, float sphereRadius, Predicate<net.minecraft.core.BlockPos> predicate) static boolean
isReplaceble
(net.minecraft.core.BlockPos pos)
-
Constructor Details
-
WorldUtils
public WorldUtils()
-
-
Method Details
-
getEntities
- Returns:
- all loaded entities
-
getEntities
public static List<net.minecraft.world.entity.Entity> getEntities(Predicate<net.minecraft.world.entity.Entity> predicate) - Returns:
- all loaded entities
-
getEntitiesSorted
- Returns:
- all loaded entities sorted by distance to camera
-
getEntitiesSorted
public static List<net.minecraft.world.entity.Entity> getEntitiesSorted(net.minecraft.world.entity.Entity entity) - Returns:
- all loaded entities sorted by distance to entity
-
getEntitiesSorted
public static List<net.minecraft.world.entity.Entity> getEntitiesSorted(net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.entity.Entity> predicate) - Returns:
- all loaded entities sorted by distance to entity
-
getChunks
-
getBlockEntities
public static List<net.minecraft.world.level.block.entity.BlockEntity> getBlockEntities(boolean sorted) -
getSphere
public static List<net.minecraft.core.BlockPos> getSphere(net.minecraft.core.Vec3i center, float sphereRadius) - Returns:
- a sphere of block positions
-
getSphere
public static List<net.minecraft.core.BlockPos> getSphere(net.minecraft.core.Vec3i center, float sphereRadius, Predicate<net.minecraft.core.BlockPos> predicate) - Parameters:
predicate
- a predicate for which all positions will be tested against- Returns:
- a sphere of block positions
-
getCircle
public static List<net.minecraft.core.BlockPos> getCircle(net.minecraft.core.Vec3i center, float circleRadius) - Returns:
- a circle of block positions
-
isReplaceble
public static boolean isReplaceble(net.minecraft.core.BlockPos pos) - Returns:
- true if the position is air or contains a replaceable block
-
checkCollision
public static boolean checkCollision(net.minecraft.core.BlockPos pos) - Returns:
- true if the position is free of entities that would prevent placing
-
checkCollision
public static boolean checkCollision(net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.VoxelShape shape, Predicate<net.minecraft.world.entity.Entity> predicate) - Parameters:
shape
- the shape in which we are checking for collisionpredicate
- a predicate for which all entities will be tested against- Returns:
- true if the position is free of entities that would prevent placing
-