Search in sources :

Example 1 with EndCrystalEntity

use of net.minecraft.entity.decoration.EndCrystalEntity in project BleachHack by BleachDrinker420.

the class AutoLog method getLogText.

private Text getLogText() {
    boolean hasTotem = mc.player.getMainHandStack().getItem() == Items.TOTEM_OF_UNDYING || mc.player.getOffHandStack().getItem() == Items.TOTEM_OF_UNDYING;
    int playerHealth = (int) (mc.player.getHealth() + mc.player.getAbsorptionAmount());
    if (getSetting(0).asToggle().getState()) {
        int health = getSetting(0).asToggle().getChild(0).asSlider().getValueInt();
        if ((getSetting(0).asToggle().getChild(1).asToggle().getState() || !hasTotem) && playerHealth <= health) {
            return new LiteralText("[AutoLog] Your health (" + playerHealth + " HP) was lower than " + health + " HP.");
        }
        if (getSetting(0).asToggle().getChild(2).asToggle().getState() && mc.player.getVehicle() instanceof LivingEntity) {
            LivingEntity vehicle = (LivingEntity) mc.player.getVehicle();
            int vehicleHealth = (int) (vehicle.getHealth() + vehicle.getAbsorptionAmount());
            if (vehicleHealth < health) {
                return new LiteralText("[AutoLog] Your vehicle health (" + vehicleHealth + " HP) was lower than " + health + " HP.");
            }
        }
    }
    if (getSetting(1).asToggle().getState() && !hasTotem) {
        for (PlayerEntity player : mc.world.getPlayers()) {
            if ((!getSetting(1).asToggle().getChild(0).asToggle().getState() && BleachHack.friendMang.has(player)) || player == mc.player) {
                continue;
            }
            int attackDamage = (int) DamageUtils.getAttackDamage(player, mc.player);
            if (player.distanceTo(mc.player) <= 6 && attackDamage >= playerHealth) {
                return new LiteralText("[AutoLog] " + player.getDisplayName().getString() + " could kill you (dealing " + attackDamage + " damage).");
            }
        }
    }
    if (getSetting(2).asToggle().getState()) {
        for (Entity e : mc.world.getEntities()) {
            if (e instanceof EndCrystalEntity && mc.player.distanceTo(e) <= getSetting(2).asToggle().getChild(0).asSlider().getValue()) {
                return new LiteralText("[AutoLog] End crystal appeared within range.");
            }
        }
    }
    if (getSetting(3).asToggle().getState()) {
        double range = getSetting(3).asToggle().getChild(0).asToggle().getState() ? getSetting(3).asToggle().getChild(0).asToggle().getChild(0).asSlider().getValue() : Double.MAX_VALUE;
        for (PlayerEntity player : mc.world.getPlayers()) {
            if (!EntityUtils.isOtherServerPlayer(player) || (!getSetting(3).asToggle().getChild(1).asToggle().getState() && BleachHack.friendMang.has(player))) {
                continue;
            }
            if (player.distanceTo(mc.player) <= range) {
                return new LiteralText("[AutoLog] " + player.getDisplayName().getString() + " appeared " + (int) player.distanceTo(mc.player) + " blocks away.");
            }
        }
    }
    return null;
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) Entity(net.minecraft.entity.Entity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) LiteralText(net.minecraft.text.LiteralText) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 2 with EndCrystalEntity

use of net.minecraft.entity.decoration.EndCrystalEntity in project tanuki by AntiCope.

the class AntiCrystal method onTick.

@EventHandler
private void onTick(TickEvent.Post event) {
    assert mc.world != null;
    assert mc.player != null;
    Optional<EndCrystalEntity> crystalTarget = Streams.stream(mc.world.getEntities()).filter(e -> (e instanceof EndCrystalEntity)).filter(e -> e.distanceTo(mc.player) <= range.get() * 2).filter(e -> mc.world.getBlockState(e.getBlockPos()).isAir()).min(Comparator.comparingDouble(o -> o.distanceTo(mc.player))).map(e -> (EndCrystalEntity) e);
    crystalTarget.ifPresent(crystal -> {
        if (mode.get() == Mode.PressurePlate) {
            FindItemResult result = InvUtils.find(PLATES);
            if (!result.found())
                return;
            BlockUtils.place(crystal.getBlockPos(), result, rotate.get(), 100);
        } else if (mode.get() == Mode.Button) {
            FindItemResult result = InvUtils.find(BUTTONS);
            if (!result.found())
                return;
            BlockUtils.place(crystal.getBlockPos(), result, rotate.get(), 100);
        }
    });
}
Also used : BlockUtils(meteordevelopment.meteorclient.utils.world.BlockUtils) Setting(meteordevelopment.meteorclient.settings.Setting) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) Item(net.minecraft.item.Item) Tanuki(anticope.tanuki.Tanuki) SettingGroup(meteordevelopment.meteorclient.settings.SettingGroup) Items(net.minecraft.item.Items) Streams(com.google.common.collect.Streams) TickEvent(meteordevelopment.meteorclient.events.world.TickEvent) Module(meteordevelopment.meteorclient.systems.modules.Module) BoolSetting(meteordevelopment.meteorclient.settings.BoolSetting) FindItemResult(meteordevelopment.meteorclient.utils.player.FindItemResult) InvUtils(meteordevelopment.meteorclient.utils.player.InvUtils) Optional(java.util.Optional) EnumSetting(meteordevelopment.meteorclient.settings.EnumSetting) Comparator(java.util.Comparator) EventHandler(meteordevelopment.orbit.EventHandler) DoubleSetting(meteordevelopment.meteorclient.settings.DoubleSetting) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) FindItemResult(meteordevelopment.meteorclient.utils.player.FindItemResult) EventHandler(meteordevelopment.orbit.EventHandler)

Example 3 with EndCrystalEntity

use of net.minecraft.entity.decoration.EndCrystalEntity in project meteor-client by MeteorDevelopment.

the class AutoLog method onTick.

@EventHandler
private void onTick(TickEvent.Post event) {
    if (mc.player.getHealth() <= 0) {
        this.toggle();
        return;
    }
    if (mc.player.getHealth() <= health.get()) {
        mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] Health was lower than " + health.get() + ".")));
        if (smartToggle.get()) {
            this.toggle();
            enableHealthListener();
        }
    }
    if (smart.get() && mc.player.getHealth() + mc.player.getAbsorptionAmount() - PlayerUtils.possibleHealthReductions() < health.get()) {
        mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] Health was going to be lower than " + health.get() + ".")));
        if (toggleOff.get())
            this.toggle();
    }
    for (Entity entity : mc.world.getEntities()) {
        if (entity instanceof PlayerEntity && entity.getUuid() != mc.player.getUuid()) {
            if (onlyTrusted.get() && entity != mc.player && !Friends.get().isFriend((PlayerEntity) entity)) {
                mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] A non-trusted player appeared in your render distance.")));
                if (toggleOff.get())
                    this.toggle();
                break;
            }
            if (mc.player.distanceTo(entity) < 8 && instantDeath.get() && DamageUtils.getSwordDamage((PlayerEntity) entity, true) > mc.player.getHealth() + mc.player.getAbsorptionAmount()) {
                mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] Anti-32k measures.")));
                if (toggleOff.get())
                    this.toggle();
                break;
            }
        }
        if (entity instanceof EndCrystalEntity && mc.player.distanceTo(entity) < range.get() && crystalLog.get()) {
            mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] End Crystal appeared within specified range.")));
            if (toggleOff.get())
                this.toggle();
        }
    }
}
Also used : Entity(net.minecraft.entity.Entity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) DisconnectS2CPacket(net.minecraft.network.packet.s2c.play.DisconnectS2CPacket) LiteralText(net.minecraft.text.LiteralText) PlayerEntity(net.minecraft.entity.player.PlayerEntity) EventHandler(meteordevelopment.orbit.EventHandler)

Example 4 with EndCrystalEntity

use of net.minecraft.entity.decoration.EndCrystalEntity in project Client by MatHax.

the class SelfProtect method onTick.

@EventHandler
private void onTick(TickEvent.Pre event) {
    if (antiAnchorAura.get() && mc.world.getBlockState(mc.player.getBlockPos().up(2)).getBlock() == Blocks.RESPAWN_ANCHOR && mc.world.getBlockState(mc.player.getBlockPos().up()).getBlock() == Blocks.AIR)
        BlockUtils.place(mc.player.getBlockPos().add(0, 1, 0), InvUtils.findInHotbar(itemStack -> Block.getBlockFromItem(itemStack.getItem()) instanceof SlabBlock), rotate.get(), 15, swing.get(), false, true);
    BlockPos top = mc.player.getBlockPos().up(2);
    if (antiCEVBreaker.get() && mc.world.getBlockState(top).getBlock() == Blocks.OBSIDIAN) {
        Iterator<Entity> iterator = mc.world.getEntities().iterator();
        coder: while (true) {
            while (true) {
                if (!iterator.hasNext())
                    break coder;
                Entity crystal = iterator.next();
                if (crystal instanceof EndCrystalEntity && crystal.getBlockPos().equals(top.up())) {
                    mc.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.attack(crystal, mc.player.isSneaking()));
                    ceved = true;
                } else if (ceved) {
                    BlockUtils.place(top.up(), InvUtils.findInHotbar(Items.OBSIDIAN), rotate.get(), 50, true);
                    ceved = false;
                }
            }
        }
    }
    if (antiTNTAura.get()) {
        if (mc.world.getBlockState(top).getBlock().equals(Blocks.TNT)) {
            if (rotate.get())
                Rotations.rotate(Rotations.getYaw(top), Rotations.getPitch(top), () -> mine(top));
            else
                mine(top);
            tntAured = true;
        } else if (tntAured) {
            if (placeObsidian.get())
                BlockUtils.place(top, InvUtils.findInHotbar(Items.OBSIDIAN), rotate.get(), 50, true);
            tntAured = false;
        }
    }
    if (antiBedAura.get()) {
        if (onlyInHole.get() && !PlayerUtils.isInHole2(true))
            return;
        BlockPos head = mc.player.getBlockPos().up();
        if (mc.world.getBlockState(head).getBlock() instanceof BedBlock && !breaking) {
            Rotations.rotate(Rotations.getYaw(head), Rotations.getPitch(head), 50, () -> sendMinePackets(head));
            breaking = true;
        } else if (breaking) {
            Rotations.rotate(Rotations.getYaw(head), Rotations.getPitch(head), 50, () -> sendStopPackets(head));
            breaking = false;
        }
        if (smart.get()) {
            if (mc.world.getBlockState(head).getBlock() instanceof BedBlock)
                bedAured = true;
            else if (bedAured) {
                if (placeStringTop.get())
                    place(mc.player.getBlockPos().up(2));
                if (placeStringMiddle.get())
                    place(mc.player.getBlockPos().up(1));
                if (placeStringBottom.get())
                    place(mc.player.getBlockPos());
                tntAured = false;
            }
        } else if (!smart.get()) {
            if (placeStringTop.get())
                place(mc.player.getBlockPos().up(2));
            if (placeStringMiddle.get())
                place(mc.player.getBlockPos().up(1));
            if (placeStringBottom.get())
                place(mc.player.getBlockPos());
        }
    }
}
Also used : BedBlock(net.minecraft.block.BedBlock) Entity(net.minecraft.entity.Entity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) SlabBlock(net.minecraft.block.SlabBlock) BlockPos(net.minecraft.util.math.BlockPos) EventHandler(mathax.client.eventbus.EventHandler)

Example 5 with EndCrystalEntity

use of net.minecraft.entity.decoration.EndCrystalEntity in project orion by AntiCope.

the class SurroundPlus method onTick.

@EventHandler
private void onTick(TickEvent.Pre event) {
    int bpt = 0;
    if ((disableJump.get() && (mc.options.jumpKey.isPressed() || mc.player.input.jumping)) || (disableYchange.get() && mc.player.prevY < mc.player.getY())) {
        toggle();
        return;
    }
    if (groundOnly.get() && !mc.player.isOnGround())
        return;
    if (sneakOnly.get() && !mc.options.sneakKey.isPressed())
        return;
    if (BlockHelper.isVecComplete(getSurrDesign())) {
        if (disableAfter.get()) {
            info("Surround Complete.");
            toggle();
        }
    } else {
        BlockPos ppos = mc.player.getBlockPos();
        for (Vec3d b : getSurrDesign()) {
            if (bpt >= blockPerTick.get())
                return;
            BlockPos bb = ppos.add(b.x, b.y, b.z);
            if (BlockHelper.getBlock(bb) == Blocks.AIR) {
                if (placeInside.get()) {
                    BlockUtils.place(bb, InvUtils.findInHotbar(itemStack -> blocks.get().contains(Block.getBlockFromItem(itemStack.getItem()))), rotation.get(), 100, false);
                } else {
                    BlockUtils.place(bb, InvUtils.findInHotbar(itemStack -> blocks.get().contains(Block.getBlockFromItem(itemStack.getItem()))), rotation.get(), 100, true);
                }
                bpt++;
            }
        }
    }
    if (protect.get()) {
        for (Entity entity : mc.world.getEntities()) {
            if (entity instanceof EndCrystalEntity) {
                BlockPos crystalPos = entity.getBlockPos();
                if (isDangerousCrystal(crystalPos)) {
                    mc.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.attack(entity, mc.player.isSneaking()));
                    mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
                    return;
                }
            }
        }
    }
}
Also used : BlockUtils(meteordevelopment.meteorclient.utils.world.BlockUtils) Entity(net.minecraft.entity.Entity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) HandSwingC2SPacket(net.minecraft.network.packet.c2s.play.HandSwingC2SPacket) ShapeMode(meteordevelopment.meteorclient.renderer.ShapeMode) meteordevelopment.meteorclient.settings(meteordevelopment.meteorclient.settings) BlockHelper(me.ghosttypes.orion.utils.world.BlockHelper) BlockPos(net.minecraft.util.math.BlockPos) SettingColor(meteordevelopment.meteorclient.utils.render.color.SettingColor) Blocks(net.minecraft.block.Blocks) TickEvent(meteordevelopment.meteorclient.events.world.TickEvent) ArrayList(java.util.ArrayList) List(java.util.List) Module(meteordevelopment.meteorclient.systems.modules.Module) PlayerUtils(meteordevelopment.meteorclient.utils.player.PlayerUtils) Block(net.minecraft.block.Block) Vec3d(net.minecraft.util.math.Vec3d) InvUtils(meteordevelopment.meteorclient.utils.player.InvUtils) PlayerInteractEntityC2SPacket(net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket) Orion(me.ghosttypes.orion.Orion) Hand(net.minecraft.util.Hand) EventHandler(meteordevelopment.orbit.EventHandler) Collections(java.util.Collections) Render3DEvent(meteordevelopment.meteorclient.events.render.Render3DEvent) Entity(net.minecraft.entity.Entity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) HandSwingC2SPacket(net.minecraft.network.packet.c2s.play.HandSwingC2SPacket) BlockPos(net.minecraft.util.math.BlockPos) Vec3d(net.minecraft.util.math.Vec3d) EventHandler(meteordevelopment.orbit.EventHandler)

Aggregations

EndCrystalEntity (net.minecraft.entity.decoration.EndCrystalEntity)9 Entity (net.minecraft.entity.Entity)5 PlayerEntity (net.minecraft.entity.player.PlayerEntity)5 BlockPos (net.minecraft.util.math.BlockPos)5 Streams (com.google.common.collect.Streams)3 EventHandler (mathax.client.eventbus.EventHandler)3 Blocks (net.minecraft.block.Blocks)3 LivingEntity (net.minecraft.entity.LivingEntity)3 Items (net.minecraft.item.Items)3 Hand (net.minecraft.util.Hand)3 Vec3d (net.minecraft.util.math.Vec3d)3 List (java.util.List)2 Entry (java.util.Map.Entry)2 Collectors (java.util.stream.Collectors)2 EventHandler (meteordevelopment.orbit.EventHandler)2 BlockState (net.minecraft.block.BlockState)2 StatusEffects (net.minecraft.entity.effect.StatusEffects)2 LiteralText (net.minecraft.text.LiteralText)2 BlockHitResult (net.minecraft.util.hit.BlockHitResult)2 Box (net.minecraft.util.math.Box)2