Class WorldHelper

java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.WorldHelper

public class WorldHelper extends Object
Helper methods for checking the Minecraft world.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Optional<net.minecraft.world.level.Level>
    Gets the world by name
    static 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>
    T
    getEntityByUUID(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

    Methods inherited from class java.lang.Object

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

    • WorldHelper

      public WorldHelper()
  • Method Details

    • findLevel

      public static Optional<net.minecraft.world.level.Level> findLevel(String name)
      Gets the world by name
      Parameters:
      name - The name of the world
      Returns:
      The potential world
    • getEntityByUUID

      public static <T extends net.minecraft.world.entity.Entity> T getEntityByUUID(net.minecraft.server.level.ServerLevel world, UUID uuid, Class<T> clazz)
    • 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 in
      posX - The x pos
      posY - The y pos
      posZ - The z pos
      r - The red value
      g - The green value
      b - 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)