Class WorldHelper
java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.WorldHelper
Helper methods for checking the Minecraft world.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<net.minecraft.world.level.Level>
Gets the world by namestatic List<net.minecraft.world.level.block.entity.BlockEntity>
getBlockEntitiesWithinAABB
(net.minecraft.world.level.Level world, net.minecraft.world.phys.AABB aabb) static <T extends net.minecraft.world.entity.Entity>
TgetEntityByUUID
(net.minecraft.server.level.ServerLevel world, UUID uuid, Class<T> clazz) static int
getWaterDepth
(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level worldObj) Finds the depth of water starting from the given position.static boolean
insideStructure
(net.minecraft.server.level.ServerLevel world, String structure, net.minecraft.core.BlockPos pos) static void
onLoad
(net.minecraftforge.event.level.ChunkEvent.Load event) static void
onUnload
(net.minecraftforge.event.level.ChunkEvent.Unload event) static net.minecraft.world.phys.HitResult
rayTraceEyes
(net.minecraft.world.entity.LivingEntity entity, double length) static void
spawnRedstoneParticle
(net.minecraft.world.level.Level world, double posX, double posY, double posZ, double r, double g, double b) Spawns PARTICLES for redstone
-
Constructor Details
-
WorldHelper
public WorldHelper()
-
-
Method Details
-
findLevel
Gets the world by name- Parameters:
name
- The name of the world- Returns:
- The potential world
-
getEntityByUUID
-
getWaterDepth
public static int getWaterDepth(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level worldObj) Finds the depth of water starting from the given position.- Parameters:
pos
- The position of the water block to start at.worldObj
- The world that the water block is in.- Returns:
- The depth of the water at the given position, or 0 if the position is not in water.
-
spawnRedstoneParticle
public static void spawnRedstoneParticle(net.minecraft.world.level.Level world, double posX, double posY, double posZ, double r, double g, double b) Spawns PARTICLES for redstone- Parameters:
world
- The world particles are appearing inposX
- The x posposY
- The y posposZ
- The z posr
- The red valueg
- The green valueb
- The blue value
-
rayTraceEyes
@Nullable public static net.minecraft.world.phys.HitResult rayTraceEyes(net.minecraft.world.entity.LivingEntity entity, double length) -
onLoad
public static void onLoad(net.minecraftforge.event.level.ChunkEvent.Load event) -
onUnload
public static void onUnload(net.minecraftforge.event.level.ChunkEvent.Unload event) -
insideStructure
public static boolean insideStructure(net.minecraft.server.level.ServerLevel world, String structure, net.minecraft.core.BlockPos pos) -
getBlockEntitiesWithinAABB
public static List<net.minecraft.world.level.block.entity.BlockEntity> getBlockEntitiesWithinAABB(net.minecraft.world.level.Level world, net.minecraft.world.phys.AABB aabb)
-