public class MinecraftHelpers
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MinecraftHelpers.NBTTag_Types
The types of NBT Tags, used for the second parameter in
NBTTagCompound.getTagList(String, int). |
| Modifier and Type | Field and Description |
|---|---|
static int |
BLOCK_NOTIFY
Cause a regular block update.
|
static int |
BLOCK_NOTIFY_CLIENT
Send a block update to the client.
|
static int |
BLOCK_NOTIFY_NO_RERENDER
Stop the block from re-rendering.
|
static java.util.List<java.lang.String> |
CHESTGENCATEGORIES
A list of all the
ChestGenHooks. |
static int |
COMPARATOR_MULTIPLIER
The amount of steps there are in a vanilla comparator.
|
static int |
MINECRAFT_DAY
The length of one Minecraft day.
|
static int |
SECOND_IN_TICKS
The amount of ticks that go in one second.
|
| Constructor and Description |
|---|
MinecraftHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static void |
dropItems(net.minecraft.world.World world,
net.minecraft.inventory.IInventory inventory,
int x,
int y,
int z)
Drop an ItemStack into the world
|
static void |
dropItems(net.minecraft.world.World world,
net.minecraft.item.ItemStack stack,
int x,
int y,
int z)
Drop an ItemStack into the world
|
static boolean |
isClientSide()
Check if this code is ran on client side.
|
static boolean |
isDay(net.minecraft.world.World world)
Check if it's day in this world.
|
static boolean |
isFluidAndAmountEqual(net.minecraftforge.fluids.FluidStack fluid1,
net.minecraftforge.fluids.FluidStack fluid2)
Check if two fluid stacks contain the same fluid and have the same amount of that fluid.
|
static boolean |
isPlayerInventoryFull(net.minecraft.entity.player.EntityPlayer player)
Check if the given player inventory is full.
|
static boolean |
isShifted() |
static void |
postDestroyBlock(net.minecraft.world.World world,
int x,
int y,
int z)
This method should be called after a BlockContainer is destroyed
|
static void |
preDestroyBlock(ConfigurableBlockContainer block,
net.minecraft.world.World world,
int x,
int y,
int z,
boolean saveNBT)
This method should be called when a BlockContainer is destroyed
|
static void |
setDay(net.minecraft.world.World world,
boolean toDay)
Set the world time to day or night.
|
static net.minecraft.entity.Entity |
spawnCreature(net.minecraft.world.World world,
int entityID,
double x,
double y,
double z)
Spawns the creature specified by the egg's type in the location specified by the last three parameters.
|
public static final int MINECRAFT_DAY
public static final int COMPARATOR_MULTIPLIER
public static final int SECOND_IN_TICKS
public static final int BLOCK_NOTIFY
public static final int BLOCK_NOTIFY_CLIENT
public static final int BLOCK_NOTIFY_NO_RERENDER
public static java.util.List<java.lang.String> CHESTGENCATEGORIES
ChestGenHooks.ChestGenHookspublic static boolean isDay(net.minecraft.world.World world)
world - The world.public static void setDay(net.minecraft.world.World world,
boolean toDay)
world - the world to manipulate time in.toDay - if true, set to day, otherwise to night.public static net.minecraft.entity.Entity spawnCreature(net.minecraft.world.World world,
int entityID,
double x,
double y,
double z)
world - The world.entityID - The ID of the entity.x - X coordinate.y - Y coordinate.z - Z coordinate.public static void preDestroyBlock(ConfigurableBlockContainer block, net.minecraft.world.World world, int x, int y, int z, boolean saveNBT)
block - The block.world - worldx - x coordinatey - y coordinatez - z coordinatesaveNBT - If the NBT data should be saved to the dropped item.public static void postDestroyBlock(net.minecraft.world.World world,
int x,
int y,
int z)
world - worldx - x coordinatey - y coordinatez - z coordinatepublic static void dropItems(net.minecraft.world.World world,
net.minecraft.item.ItemStack stack,
int x,
int y,
int z)
world - the worldstack - ItemStack to dropx - x coordinatey - y coordinatez - z coordinatepublic static void dropItems(net.minecraft.world.World world,
net.minecraft.inventory.IInventory inventory,
int x,
int y,
int z)
world - the worldinventory - inventory with ItemStacksx - x coordinatey - y coordinatez - z coordinatepublic static boolean isPlayerInventoryFull(net.minecraft.entity.player.EntityPlayer player)
player - The player.public static boolean isClientSide()
public static boolean isFluidAndAmountEqual(net.minecraftforge.fluids.FluidStack fluid1,
net.minecraftforge.fluids.FluidStack fluid2)
fluid1 - A fluid stack.fluid2 - A fluid stack.public static boolean isShifted()