net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen Java Examples
The following examples show how to use
net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AutoTotemHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
@Override public void onUpdate() { IClientPlayerInteractionManager im = IMC.getInteractionManager(); PlayerInventory inventory = MC.player.inventory; if(nextTickSlot != -1) { im.windowClick_PICKUP(nextTickSlot); nextTickSlot = -1; } ItemStack offhandStack = inventory.getStack(40); if(offhandStack.getItem() == Items.TOTEM_OF_UNDYING) return; if(MC.currentScreen instanceof HandledScreen && !(MC.currentScreen instanceof AbstractInventoryScreen)) return; for(int slot = 0; slot <= 36; slot++) { if(inventory.getStack(slot).getItem() != Items.TOTEM_OF_UNDYING) continue; int newTotemSlot = slot < 9 ? slot + 36 : slot; boolean offhandEmpty = offhandStack.isEmpty(); im.windowClick_PICKUP(newTotemSlot); im.windowClick_PICKUP(45); if(!offhandEmpty) nextTickSlot = newTotemSlot; break; } }
Example #2
Source File: IForgeEffect.java From patchwork-api with GNU Lesser General Public License v2.1 | 2 votes |
/** * Called to draw the {@link StatusEffectInstance} onto the player's inventory when it's active. * This can be used to e.g. render {@link StatusEffect} icons from your own texture. * * @param effect the active {@link StatusEffectInstance} * @param gui the gui instance * @param x the x coordinate * @param y the y coordinate * @param z the z level */ @Environment(EnvType.CLIENT) default void renderInventoryEffect(StatusEffectInstance effect, AbstractInventoryScreen<?> gui, int x, int y, float z) { }