public class ClientUtils
extends java.lang.Object
| Constructor and Description |
|---|
ClientUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDroneToHudHandler(EntityDrone drone,
net.minecraft.util.math.BlockPos pos) |
static void |
addGuiContextSensitiveTooltip(net.minecraft.item.ItemStack stack,
java.util.List<net.minecraft.util.text.ITextComponent> tooltip)
Add some context-sensitive info to an item's tooltip, based on the currently-open GUI.
|
static void |
closeContainerGui(net.minecraft.client.gui.screen.Screen parentScreen)
Close a container-based GUI, and restore the player's openContainer.
|
static void |
emitParticles(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.particles.IParticleData particle) |
static void |
emitParticles(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.particles.IParticleData particle,
double yOffset)
Emit particles from just above the given blockpos, which is generally a machine or similar.
|
static float |
getBrightnessAtWorldHeight() |
static net.minecraft.entity.player.PlayerEntity |
getClientPlayer() |
static net.minecraft.tileentity.TileEntity |
getClientTE(net.minecraft.util.math.BlockPos pos)
Get a TE client-side.
|
static net.minecraft.world.World |
getClientWorld()
For use where we can't reference Minecraft directly, e.g.
|
static int |
getLightAt(net.minecraft.util.math.BlockPos pos) |
static int |
getRenderDistanceThresholdSq()
Get the render distance based on current game settings
|
static int |
getStringWidth(java.lang.String line) |
static float[] |
getTextureUV(net.minecraft.block.BlockState state,
net.minecraft.util.Direction face) |
static net.minecraft.item.ItemStack |
getWornArmor(net.minecraft.inventory.EquipmentSlotType slot) |
static boolean |
hasShiftDown() |
static boolean |
intersects(net.minecraft.client.renderer.Rectangle2d rect,
double x,
double y,
double w,
double h)
Same as AWT Rectangle's intersects() method, but we don't have access to AWT...
|
static boolean |
isFirstPersonCamera() |
static boolean |
isGuiOpen(net.minecraft.tileentity.TileEntity te) |
static boolean |
isKeyDown(int keyCode) |
static boolean |
isScreenHiRes()
For the programmer GUI
|
static void |
openContainerGui(net.minecraft.inventory.container.ContainerType<? extends net.minecraft.inventory.container.Container> type,
net.minecraft.util.text.ITextComponent displayString)
Open a container-based GUI client-side.
|
static void |
spawnEntityClientside(net.minecraft.entity.Entity e) |
static java.lang.String |
translateDirection(net.minecraft.util.Direction d) |
static net.minecraft.util.text.ITextComponent |
translateDirectionComponent(net.minecraft.util.Direction d) |
static net.minecraft.util.text.ITextComponent |
translateKeyBind(net.minecraft.client.settings.KeyBinding keyBinding)
Because keyBinding.getTranslationKey() doesn't work that well...
|
public static void emitParticles(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.particles.IParticleData particle,
double yOffset)
world - the worldpos - the block posparticle - the particle typepublic static void emitParticles(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.particles.IParticleData particle)
@Nonnull public static net.minecraft.item.ItemStack getWornArmor(net.minecraft.inventory.EquipmentSlotType slot)
public static void addDroneToHudHandler(EntityDrone drone, net.minecraft.util.math.BlockPos pos)
public static boolean isKeyDown(int keyCode)
public static void openContainerGui(net.minecraft.inventory.container.ContainerType<? extends net.minecraft.inventory.container.Container> type,
net.minecraft.util.text.ITextComponent displayString)
closeContainerGui(Screen) from the opened GUI's onClose() method to restore
the player's openContainer to the correct container. Therefore the GUI being opened should remember the previous
open GUI, and call closeContainerGui(Screen) with that GUI as an argument.type - the container type to opendisplayString - container's display namepublic static void closeContainerGui(net.minecraft.client.gui.screen.Screen parentScreen)
openContainerGui(ContainerType, ITextComponent)parentScreen - the previously-opened GUI, which will be re-openedpublic static net.minecraft.world.World getClientWorld()
public static net.minecraft.entity.player.PlayerEntity getClientPlayer()
public static boolean hasShiftDown()
public static net.minecraft.tileentity.TileEntity getClientTE(net.minecraft.util.math.BlockPos pos)
public static boolean intersects(net.minecraft.client.renderer.Rectangle2d rect,
double x,
double y,
double w,
double h)
rect - a rectanglex - x coordy - y coordw - widthh - heightpublic static boolean isScreenHiRes()
public static float getBrightnessAtWorldHeight()
public static int getLightAt(net.minecraft.util.math.BlockPos pos)
public static int getStringWidth(java.lang.String line)
public static boolean isGuiOpen(net.minecraft.tileentity.TileEntity te)
public static float[] getTextureUV(net.minecraft.block.BlockState state,
net.minecraft.util.Direction face)
public static void spawnEntityClientside(net.minecraft.entity.Entity e)
public static java.lang.String translateDirection(net.minecraft.util.Direction d)
public static net.minecraft.util.text.ITextComponent translateDirectionComponent(net.minecraft.util.Direction d)
public static net.minecraft.util.text.ITextComponent translateKeyBind(net.minecraft.client.settings.KeyBinding keyBinding)
keyBinding - the keybindingpublic static void addGuiContextSensitiveTooltip(net.minecraft.item.ItemStack stack,
java.util.List<net.minecraft.util.text.ITextComponent> tooltip)
stack - the item stacktooltip - tooltip to add data topublic static int getRenderDistanceThresholdSq()
public static boolean isFirstPersonCamera()