public class WorldUtils
extends java.lang.Object
Constructor and Description |
---|
WorldUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
breakBlockSavingNBT(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
IToolable block)
Breaks the block and saves the NBT to the tag, calls getStackDropped to drop (just item)
|
static boolean |
doesContainAirBlock(net.minecraft.world.World world,
java.util.List<net.minecraft.util.math.BlockPos> blocks,
net.minecraft.util.math.BlockPos origin)
Checks if there is air within the given list
|
static void |
dropStack(net.minecraft.world.World world,
net.minecraft.item.ItemStack stack,
net.minecraft.util.math.BlockPos pos)
Drops a ItemStack into the world
|
static void |
dropStacks(net.minecraft.world.World world,
java.util.List<net.minecraft.item.ItemStack> stacks,
net.minecraft.util.math.BlockPos pos)
Drops and Array of ItemStacks into the world
|
static void |
dropStacksInInventory(net.minecraftforge.items.IItemHandler itemHandler,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Helper method to drop items in an inventory, used on break mostly
|
static net.minecraft.util.Direction |
rotateLeft(net.minecraft.util.Direction toTurn)
Returns the direction to the left of this.
|
static net.minecraft.util.Direction |
rotateRight(net.minecraft.util.Direction toTurn)
Returns the direction to the right of this.
|
static void |
writeStackNBTToBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.item.ItemStack stack)
Call this after onBlockPlacedBy to write saved data to the stack if present
|
public static net.minecraft.util.Direction rotateLeft(net.minecraft.util.Direction toTurn)
toTurn
- Starting pointpublic static net.minecraft.util.Direction rotateRight(net.minecraft.util.Direction toTurn)
toTurn
- Starting pointpublic static boolean doesContainAirBlock(net.minecraft.world.World world, java.util.List<net.minecraft.util.math.BlockPos> blocks, net.minecraft.util.math.BlockPos origin)
world
- The worldblocks
- The list of offsets from the originorigin
- The origin to compare againstpublic static void dropStacks(net.minecraft.world.World world, java.util.List<net.minecraft.item.ItemStack> stacks, net.minecraft.util.math.BlockPos pos)
world
- Instance of ``Worldstacks
- ItemStack Array to drop into the worldpos
- BlockPos to drop them frompublic static void dropStack(net.minecraft.world.World world, net.minecraft.item.ItemStack stack, net.minecraft.util.math.BlockPos pos)
world
- Instance of ``Worldstack
- temStack Array to drop into the worldpos
- BlockPos to drop them frompublic static void dropStacksInInventory(net.minecraftforge.items.IItemHandler itemHandler, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
itemHandler
- The itemhandlerworld
- The worldpos
- The block pospublic static boolean breakBlockSavingNBT(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, @Nonnull IToolable block)
world
- The worldpos
- The block posblock
- The block objectpublic static void writeStackNBTToBlock(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.item.ItemStack stack)
world
- The worldpos
- The block positionstack
- The stack that had the tag