public class LocationHelpers
extends java.lang.Object
ILocationS and NetworkRegistry.TargetPointS.| Modifier and Type | Class and Description |
|---|---|
static class |
LocationHelpers.LocationException
Exceptions that can occur with location manipulation.
|
| Constructor and Description |
|---|
LocationHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static cpw.mods.fml.common.network.NetworkRegistry.TargetPoint |
createTargetPointFromEntityPosition(net.minecraft.entity.Entity entity,
int range)
Creates a
NetworkRegistry.TargetPoint for the dimension and position of the given Entity
and a given range. |
static cpw.mods.fml.common.network.NetworkRegistry.TargetPoint |
createTargetPointFromLocation(net.minecraft.world.World world,
ILocation location,
int range)
Creates a
NetworkRegistry.TargetPoint for the dimension of the given world and the
given ILocation. |
static net.minecraft.block.Block |
getBlock(net.minecraft.world.World world,
ILocation location)
Get the block from a location in a world.
|
static int |
getBlockMeta(net.minecraft.world.World world,
ILocation location)
Get the block metadata from a location in a world.
|
static ILocation |
getRandomPointInSphere(ILocation center,
int radius)
Get a random point inside a sphere in an efficient way.
|
static net.minecraft.tileentity.TileEntity |
getTile(net.minecraft.world.World world,
ILocation location)
Get the tile entity from a location in a world.
|
static void |
setBlock(net.minecraft.world.World world,
ILocation location,
net.minecraft.block.Block block)
Set the block.
|
static void |
setBlockMetadata(net.minecraft.world.World world,
ILocation location,
int meta,
int notifyFlag)
Set the block metadata.
|
public static cpw.mods.fml.common.network.NetworkRegistry.TargetPoint createTargetPointFromEntityPosition(net.minecraft.entity.Entity entity,
int range)
NetworkRegistry.TargetPoint for the dimension and position of the given Entity
and a given range.entity - Entity who's dimension and position will be used to create the NetworkRegistry.TargetPoint.range - The range of the NetworkRegistry.TargetPoint.NetworkRegistry.TargetPoint with the position and dimension of the entity and the given range.public static cpw.mods.fml.common.network.NetworkRegistry.TargetPoint createTargetPointFromLocation(net.minecraft.world.World world,
ILocation location,
int range)
NetworkRegistry.TargetPoint for the dimension of the given world and the
given ILocation.world - The world from which the dimension will be used.location - The location for the target.range - The range of the NetworkRegistry.TargetPoint.NetworkRegistry.TargetPoint with the position and dimension of the entity and the given range.public static net.minecraft.block.Block getBlock(net.minecraft.world.World world,
ILocation location)
throws LocationHelpers.LocationException
world - The world.location - The location.LocationHelpers.LocationException - If the given location does not have exactly three dimensions.public static int getBlockMeta(net.minecraft.world.World world,
ILocation location)
throws LocationHelpers.LocationException
world - The world.location - The location.LocationHelpers.LocationException - If the given location does not have exactly three dimensions.public static net.minecraft.tileentity.TileEntity getTile(net.minecraft.world.World world,
ILocation location)
throws LocationHelpers.LocationException
world - The world.location - The location.LocationHelpers.LocationException - If the given location does not have exactly three dimensions.public static void setBlock(net.minecraft.world.World world,
ILocation location,
net.minecraft.block.Block block)
throws LocationHelpers.LocationException
world - The world.location - The location.block - The block to set.LocationHelpers.LocationException - If the given location does not have exactly three dimensions.public static void setBlockMetadata(net.minecraft.world.World world,
ILocation location,
int meta,
int notifyFlag)
throws LocationHelpers.LocationException
world - The world.location - The location.meta - The meta value to set.notifyFlag - The flag to set. See the BLOCK_NOTIFY_* fields in Helpers
for more info, these can be or-ed together.LocationHelpers.LocationException - If the given location does not have exactly three dimensions.