public final class BlockUtil
extends java.lang.Object
Constructor and Description |
---|
BlockUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.Comparator<net.minecraft.block.state.IBlockState> |
blockStateComparator() |
static boolean |
blockStatesEqual(net.minecraft.block.state.IBlockState a,
net.minecraft.block.state.IBlockState b) |
static boolean |
blockStatesEqual(net.minecraft.block.state.IBlockState a,
net.minecraft.block.state.IBlockState b,
java.util.Collection<net.minecraft.block.properties.IProperty<?>> ignoredProperties) |
static boolean |
blockStatesWithoutBlockEqual(net.minecraft.block.state.IBlockState a,
net.minecraft.block.state.IBlockState b) |
static boolean |
blockStatesWithoutBlockEqual(net.minecraft.block.state.IBlockState a,
net.minecraft.block.state.IBlockState b,
java.util.Collection<net.minecraft.block.properties.IProperty<?>> ignoredProperties) |
static boolean |
breakBlock(net.minecraft.world.WorldServer world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.BlockPos ownerPos,
com.mojang.authlib.GameProfile owner) |
static boolean |
breakBlock(net.minecraft.world.WorldServer world,
net.minecraft.util.math.BlockPos pos,
int forcedLifespan,
net.minecraft.util.math.BlockPos ownerPos,
com.mojang.authlib.GameProfile owner) |
static boolean |
breakBlock(net.minecraft.world.WorldServer world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> drops,
net.minecraft.util.math.BlockPos ownerPos,
com.mojang.authlib.GameProfile owner) |
static boolean |
canChangeBlock(net.minecraft.block.state.IBlockState state,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
com.mojang.authlib.GameProfile owner) |
static boolean |
canChangeBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
com.mojang.authlib.GameProfile owner) |
static <T extends java.lang.Comparable<T>> |
compareProperty(net.minecraft.block.properties.IProperty<T> property,
net.minecraft.block.state.IBlockState a,
net.minecraft.block.state.IBlockState b) |
static long |
computeBlockBreakPower(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos) |
static <T extends java.lang.Comparable<T>> |
copyProperty(net.minecraft.block.properties.IProperty<T> property,
net.minecraft.block.state.IBlockState dst,
net.minecraft.block.state.IBlockState src) |
static net.minecraftforge.fluids.FluidStack |
drainBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean doDrain) |
static void |
dropItem(net.minecraft.world.WorldServer world,
net.minecraft.util.math.BlockPos pos,
int forcedLifespan,
net.minecraft.item.ItemStack stack) |
static void |
explodeBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Create an explosion which only affects a single block.
|
static float |
getBlockHardnessMining(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
com.mojang.authlib.GameProfile owner) |
static net.minecraft.block.state.IBlockState |
getBlockState(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos) |
static net.minecraft.block.state.IBlockState |
getBlockState(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean force) |
static net.minecraftforge.common.util.FakePlayer |
getFakePlayerWithTool(net.minecraft.world.WorldServer world,
net.minecraft.item.ItemStack tool,
com.mojang.authlib.GameProfile owner) |
static net.minecraftforge.fluids.Fluid |
getFluid(net.minecraft.block.Block block) |
static net.minecraftforge.fluids.Fluid |
getFluid(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos) |
static net.minecraftforge.fluids.Fluid |
getFluidWithFlowing(net.minecraft.block.Block block) |
static net.minecraftforge.fluids.Fluid |
getFluidWithFlowing(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos) |
static net.minecraftforge.fluids.Fluid |
getFluidWithoutFlowing(net.minecraft.block.state.IBlockState state) |
static net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> |
getItemStackFromBlock(net.minecraft.world.WorldServer world,
net.minecraft.util.math.BlockPos pos,
com.mojang.authlib.GameProfile owner) |
static net.minecraft.tileentity.TileEntityChest |
getOtherDoubleChest(net.minecraft.tileentity.TileEntity inv) |
static java.util.Map<java.lang.String,java.lang.String> |
getPropertiesStringMap(net.minecraft.block.state.IBlockState blockState) |
static java.util.Map<java.lang.String,java.lang.String> |
getPropertiesStringMap(net.minecraft.block.state.IBlockState blockState,
java.util.Collection<net.minecraft.block.properties.IProperty<?>> properties) |
static <T extends java.lang.Comparable<T>> |
getPropertyStringValue(net.minecraft.block.state.IBlockState blockState,
net.minecraft.block.properties.IProperty<T> property) |
static net.minecraft.tileentity.TileEntity |
getTileEntity(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
The following functions let you avoid unnecessary chunk loads, which is nice.
|
static net.minecraft.tileentity.TileEntity |
getTileEntity(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean force) |
static boolean |
harvestBlock(net.minecraft.world.WorldServer world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.item.ItemStack tool,
net.minecraft.util.math.BlockPos ownerPos,
com.mojang.authlib.GameProfile owner) |
static boolean |
isFullFluidBlock(net.minecraft.block.state.IBlockState state,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos) |
static boolean |
isFullFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos) |
static boolean |
isToughBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Returns true if a block cannot be harvested without a tool.
|
static boolean |
isUnbreakableBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
com.mojang.authlib.GameProfile owner) |
static boolean |
isUnbreakableBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.state.IBlockState state,
com.mojang.authlib.GameProfile owner) |
static void |
onComparatorUpdate(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.Block block) |
static java.util.Comparator<net.minecraft.util.math.BlockPos> |
uniqueBlockPosComparator(java.util.Comparator<net.minecraft.util.math.BlockPos> parent) |
static boolean |
useItemOnBlock(net.minecraft.world.World world,
net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack stack,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.EnumFacing direction) |
@Nullable public static net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> getItemStackFromBlock(net.minecraft.world.WorldServer world, net.minecraft.util.math.BlockPos pos, com.mojang.authlib.GameProfile owner)
public static boolean breakBlock(net.minecraft.world.WorldServer world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.BlockPos ownerPos, com.mojang.authlib.GameProfile owner)
public static boolean breakBlock(net.minecraft.world.WorldServer world, net.minecraft.util.math.BlockPos pos, int forcedLifespan, net.minecraft.util.math.BlockPos ownerPos, com.mojang.authlib.GameProfile owner)
public static boolean harvestBlock(net.minecraft.world.WorldServer world, net.minecraft.util.math.BlockPos pos, @Nonnull net.minecraft.item.ItemStack tool, net.minecraft.util.math.BlockPos ownerPos, com.mojang.authlib.GameProfile owner)
public static net.minecraftforge.common.util.FakePlayer getFakePlayerWithTool(net.minecraft.world.WorldServer world, @Nonnull net.minecraft.item.ItemStack tool, com.mojang.authlib.GameProfile owner)
public static boolean breakBlock(net.minecraft.world.WorldServer world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> drops, net.minecraft.util.math.BlockPos ownerPos, com.mojang.authlib.GameProfile owner)
public static void dropItem(net.minecraft.world.WorldServer world, net.minecraft.util.math.BlockPos pos, int forcedLifespan, net.minecraft.item.ItemStack stack)
public static boolean canChangeBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, com.mojang.authlib.GameProfile owner)
public static boolean canChangeBlock(net.minecraft.block.state.IBlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, com.mojang.authlib.GameProfile owner)
public static float getBlockHardnessMining(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.block.state.IBlockState state, com.mojang.authlib.GameProfile owner)
public static boolean isUnbreakableBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.block.state.IBlockState state, com.mojang.authlib.GameProfile owner)
public static boolean isUnbreakableBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, com.mojang.authlib.GameProfile owner)
public static boolean isToughBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static boolean isFullFluidBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static boolean isFullFluidBlock(net.minecraft.block.state.IBlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static net.minecraftforge.fluids.Fluid getFluid(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static net.minecraftforge.fluids.Fluid getFluidWithFlowing(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static net.minecraftforge.fluids.Fluid getFluid(net.minecraft.block.Block block)
public static net.minecraftforge.fluids.Fluid getFluidWithoutFlowing(net.minecraft.block.state.IBlockState state)
public static net.minecraftforge.fluids.Fluid getFluidWithFlowing(net.minecraft.block.Block block)
public static net.minecraftforge.fluids.FluidStack drainBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, boolean doDrain)
public static void explodeBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static long computeBlockBreakPower(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static net.minecraft.tileentity.TileEntity getTileEntity(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static net.minecraft.tileentity.TileEntity getTileEntity(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, boolean force)
public static net.minecraft.block.state.IBlockState getBlockState(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
public static net.minecraft.block.state.IBlockState getBlockState(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, boolean force)
public static boolean useItemOnBlock(net.minecraft.world.World world, net.minecraft.entity.player.EntityPlayer player, net.minecraft.item.ItemStack stack, net.minecraft.util.math.BlockPos pos, net.minecraft.util.EnumFacing direction)
public static void onComparatorUpdate(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.block.Block block)
public static net.minecraft.tileentity.TileEntityChest getOtherDoubleChest(net.minecraft.tileentity.TileEntity inv)
public static <T extends java.lang.Comparable<T>> net.minecraft.block.state.IBlockState copyProperty(net.minecraft.block.properties.IProperty<T> property, net.minecraft.block.state.IBlockState dst, net.minecraft.block.state.IBlockState src)
public static <T extends java.lang.Comparable<T>> int compareProperty(net.minecraft.block.properties.IProperty<T> property, net.minecraft.block.state.IBlockState a, net.minecraft.block.state.IBlockState b)
public static <T extends java.lang.Comparable<T>> java.lang.String getPropertyStringValue(net.minecraft.block.state.IBlockState blockState, net.minecraft.block.properties.IProperty<T> property)
public static java.util.Map<java.lang.String,java.lang.String> getPropertiesStringMap(net.minecraft.block.state.IBlockState blockState, java.util.Collection<net.minecraft.block.properties.IProperty<?>> properties)
public static java.util.Map<java.lang.String,java.lang.String> getPropertiesStringMap(net.minecraft.block.state.IBlockState blockState)
public static java.util.Comparator<net.minecraft.block.state.IBlockState> blockStateComparator()
public static boolean blockStatesWithoutBlockEqual(net.minecraft.block.state.IBlockState a, net.minecraft.block.state.IBlockState b, java.util.Collection<net.minecraft.block.properties.IProperty<?>> ignoredProperties)
public static boolean blockStatesWithoutBlockEqual(net.minecraft.block.state.IBlockState a, net.minecraft.block.state.IBlockState b)
public static boolean blockStatesEqual(net.minecraft.block.state.IBlockState a, net.minecraft.block.state.IBlockState b, java.util.Collection<net.minecraft.block.properties.IProperty<?>> ignoredProperties)
public static boolean blockStatesEqual(net.minecraft.block.state.IBlockState a, net.minecraft.block.state.IBlockState b)
public static java.util.Comparator<net.minecraft.util.math.BlockPos> uniqueBlockPosComparator(java.util.Comparator<net.minecraft.util.math.BlockPos> parent)