public class WorldHelper
extends java.lang.Object
Constructor and Description |
---|
WorldHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsBiome(java.util.Collection<net.minecraft.world.biome.Biome> biomes,
net.minecraft.world.biome.Biome biome) |
static net.minecraft.world.biome.Biome |
demandBiome(java.lang.String name)
Returns the biome with the given name.
|
static java.util.Optional<net.minecraft.world.World> |
findLevel(java.lang.String name)
Gets the world by name
|
static int |
firstBlockDownwardsFromY(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean countNonSolid)
Finds the height of the first block that is at or below the given
position.
|
static void |
fixLighting(net.minecraft.world.World world,
net.minecraft.util.math.MutableBoundingBox bb)
Updates the lighting of a structure.
|
static net.minecraft.util.RegistryKey<net.minecraft.world.biome.Biome> |
getBiomeRegistryKey(net.minecraft.world.biome.Biome biome) |
static java.util.List<net.minecraft.util.Direction> |
getDirectionsTowards(int distX,
int distZ)
Gets the direction that an x and z coordinate are located relative to (0,
0).
|
static <T extends net.minecraft.entity.Entity> |
getEntityByUUID(net.minecraft.world.server.ServerWorld world,
java.util.UUID uuid,
java.lang.Class<T> clazz) |
static int |
getWaterDepth(net.minecraft.util.math.BlockPos pos,
net.minecraft.world.ISeedReader worldObj)
Finds the depth of water starting from the given position.
|
static int |
getWaterDepth(net.minecraft.util.math.BlockPos pos,
net.minecraft.world.World worldObj)
Finds the depth of water starting from the given position.
|
static boolean |
insideStructure(net.minecraft.world.server.ServerWorld world,
net.minecraft.util.math.BlockPos pos) |
static boolean |
insideStructure(net.minecraft.world.server.ServerWorld world,
java.lang.String structure,
net.minecraft.util.math.BlockPos pos) |
static boolean |
insideStructure(net.minecraft.world.server.ServerWorld world,
net.minecraft.world.gen.feature.structure.Structure<?> value,
net.minecraft.util.math.BlockPos pos) |
static boolean |
isBiomeOfType(net.minecraft.world.biome.Biome biome,
net.minecraftforge.common.BiomeDictionary.Type type) |
static boolean |
isHorizontal(net.minecraft.util.Direction dir)
Checks whether the direction is horizontal (east or west).
|
static boolean |
isWaterOrIce(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Checks if a block is water or ice.
|
static net.minecraft.world.biome.Biome |
parseBiome(java.lang.String name)
Returns the biome with the given name.
|
static net.minecraft.util.math.RayTraceResult |
rayTraceEyes(net.minecraft.entity.LivingEntity entity,
double length) |
static void |
spawnRedstoneParticle(net.minecraft.world.World world,
double posX,
double posY,
double posZ,
double r,
double g,
double b)
Spawns PARTICLES for redstone
|
public static java.util.Optional<net.minecraft.world.World> findLevel(java.lang.String name)
name
- The name of the worldpublic static <T extends net.minecraft.entity.Entity> T getEntityByUUID(net.minecraft.world.server.ServerWorld world, java.util.UUID uuid, java.lang.Class<T> clazz)
public static boolean isHorizontal(net.minecraft.util.Direction dir)
dir
- The direction to check.public static net.minecraft.world.biome.Biome demandBiome(java.lang.String name)
name
- The name of the biome to find.public static net.minecraft.world.biome.Biome parseBiome(java.lang.String name)
name
- The name of the biome to find.public static java.util.List<net.minecraft.util.Direction> getDirectionsTowards(int distX, int distZ)
distX
- The x coordinate to get a direction for.distZ
- The z coordinate to get a direction for.public static int firstBlockDownwardsFromY(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, boolean countNonSolid)
world
- The world to search in.pos
- The position to start searching at.countNonSolid
- Whether to count non-solid blocks when searching for a block.public static int getWaterDepth(net.minecraft.util.math.BlockPos pos, net.minecraft.world.World worldObj)
pos
- The position of the water block to start at.worldObj
- The world that the water block is in.public static int getWaterDepth(net.minecraft.util.math.BlockPos pos, net.minecraft.world.ISeedReader worldObj)
Feature
s for world generationpos
- The position of the water block to start at.worldObj
- The world that the water block is in.public static boolean isWaterOrIce(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
world
- The world the block is in.pos
- The position of the block to check.public static void fixLighting(net.minecraft.world.World world, net.minecraft.util.math.MutableBoundingBox bb)
world
- The world the structure is in.bb
- The bounding box of the structure.public static void spawnRedstoneParticle(net.minecraft.world.World world, double posX, double posY, double posZ, double r, double g, double b)
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@Nullable public static net.minecraft.util.math.RayTraceResult rayTraceEyes(net.minecraft.entity.LivingEntity entity, double length)
public static boolean insideStructure(net.minecraft.world.server.ServerWorld world, java.lang.String structure, net.minecraft.util.math.BlockPos pos)
public static boolean insideStructure(net.minecraft.world.server.ServerWorld world, net.minecraft.world.gen.feature.structure.Structure<?> value, net.minecraft.util.math.BlockPos pos)
public static boolean insideStructure(net.minecraft.world.server.ServerWorld world, net.minecraft.util.math.BlockPos pos)
public static boolean containsBiome(java.util.Collection<net.minecraft.world.biome.Biome> biomes, net.minecraft.world.biome.Biome biome)
public static net.minecraft.util.RegistryKey<net.minecraft.world.biome.Biome> getBiomeRegistryKey(net.minecraft.world.biome.Biome biome)
public static boolean isBiomeOfType(net.minecraft.world.biome.Biome biome, net.minecraftforge.common.BiomeDictionary.Type type)