Search in sources :

Example 11 with AbstractClientPlayerEntity

use of net.minecraft.client.network.AbstractClientPlayerEntity 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!");
}
Also used : CmdSyntaxException(org.bleachhack.command.exception.CmdSyntaxException) MatrixStack(net.minecraft.client.util.math.MatrixStack) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity) InventoryScreen(net.minecraft.client.gui.screen.ingame.InventoryScreen)

Aggregations

AbstractClientPlayerEntity (net.minecraft.client.network.AbstractClientPlayerEntity)11 PlayerEntity (net.minecraft.entity.player.PlayerEntity)4 ItemStack (net.minecraft.item.ItemStack)3 Identifier (net.minecraft.util.Identifier)3 CapeItem (com.jab125.thonkutil.api.CapeItem)2 MinecraftClient (net.minecraft.client.MinecraftClient)2 VertexConsumer (net.minecraft.client.render.VertexConsumer)2 PlayerEntityRenderer (net.minecraft.client.render.entity.PlayerEntityRenderer)2 MatrixStack (net.minecraft.client.util.math.MatrixStack)2 BlockPos (net.minecraft.util.math.BlockPos)2 SlotReference (dev.emi.trinkets.api.SlotReference)1 TrinketRenderer (dev.emi.trinkets.api.client.TrinketRenderer)1 BufferedImage (java.awt.image.BufferedImage)1 File (java.io.File)1 IOException (java.io.IOException)1 Random (java.util.Random)1 EventHandler (mathax.client.eventbus.EventHandler)1 BroomEntityModel (moriyashiine.bewitchment.api.client.model.BroomEntityModel)1 BroomEntity (moriyashiine.bewitchment.api.entity.BroomEntity)1 ContributorHornsModel (moriyashiine.bewitchment.client.model.ContributorHornsModel)1