use of net.minecraft.client.gui.screen.ingame.InventoryScreen in project meteor-client by MeteorDevelopment.
the class EnchantCommand method syncItem.
private void syncItem() {
mc.setScreen(new InventoryScreen(mc.player));
mc.setScreen(null);
}
use of net.minecraft.client.gui.screen.ingame.InventoryScreen in project KiwiClient by TangyKiwi.
the class Enchant method syncItem.
private void syncItem() {
Utils.mc.setScreen(new InventoryScreen(Utils.mc.player));
Utils.mc.setScreen(null);
}
use of net.minecraft.client.gui.screen.ingame.InventoryScreen in project MasaGadget by plusls.
the class RestockUtil method tryCraftingRestocking.
public static void tryCraftingRestocking(PlayerEntity player, Hand hand, ItemStack itemStack) {
if (player.isCreative()) {
return;
}
updateRecipes();
// TODO: Lazy update (on itemscoller's RecipeStorage updated or config changed)
MinecraftClient mc = MinecraftClient.getInstance();
HandledScreen<? extends ScreenHandler> gui = new InventoryScreen(player);
gui.init(MinecraftClient.getInstance(), 0, 0);
for (RecipePattern recipe : RestockUtil.recipes) {
if (ItemStack.canCombine(recipe.getResult(), itemStack)) {
InventoryUtils.tryMoveItemsToFirstCraftingGrid(recipe, gui, false);
mc.interactionManager.clickSlot(player.playerScreenHandler.syncId, 0, 0, SlotActionType.PICKUP, player);
if (player.playerScreenHandler.getCursorStack().isItemEqual(itemStack)) {
mc.interactionManager.clickSlot(player.playerScreenHandler.syncId, hand == Hand.MAIN_HAND ? player.getInventory().selectedSlot + 36 : 45, 0, SlotActionType.PICKUP, player);
return;
} else {
Slot slot = CraftingHandler.getFirstCraftingOutputSlotForGui(gui);
CraftingHandler.SlotRange range = CraftingHandler.getCraftingGridSlots(gui, slot);
for (int s = range.getFirst(); s <= range.getLast(); s++) {
mc.interactionManager.clickSlot(gui.getScreenHandler().syncId, s, 0, SlotActionType.QUICK_MOVE, mc.player);
}
}
}
}
}
use of net.minecraft.client.gui.screen.ingame.InventoryScreen in project BleachHack by BleachDrinker420.
the class Freecam method onOpenScreen.
@BleachSubscribe
public void onOpenScreen(EventOpenScreen event) {
if (getSetting(1).asToggle().getState() && riding instanceof HorseBaseEntity) {
if (event.getScreen() instanceof InventoryScreen) {
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.OPEN_INVENTORY));
event.setCancelled(true);
}
}
}
use of net.minecraft.client.gui.screen.ingame.InventoryScreen in project BleachHack by BleachDrinker420.
the class CmdInvPeek method onCommand.
@Override
public void onCommand(String alias, String[] args) throws Exception {
if (args.length == 0) {
throw new CmdSyntaxException();
}
for (AbstractClientPlayerEntity e : mc.world.getPlayers()) {
if (e.getDisplayName().getString().equalsIgnoreCase(args[0])) {
BleachQueue.add(() -> {
BleachLogger.info("Opened inventory for " + e.getDisplayName().getString());
mc.setScreen(new InventoryScreen(e) {
public boolean mouseClicked(double mouseX, double mouseY, int button) {
return false;
}
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, BACKGROUND_TEXTURE);
this.drawTexture(matrices, x, y, 0, 0, this.backgroundWidth, this.backgroundHeight);
drawEntity(x + 51, y + 75, 30, (float) (x + 51) - mouseX, (float) (y + 75 - 50) - mouseY, this.client.player);
}
});
});
return;
}
}
BleachLogger.error("Player " + args[0] + " not found!");
}
Aggregations