Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.pathing.PathManagers;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.EntityTypeListSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
Expand All @@ -12,11 +13,16 @@
import meteordevelopment.meteorclient.utils.entity.SortPriority;
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.Tameable;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;

import java.util.ArrayList;
import java.util.Set;
Expand All @@ -35,6 +41,20 @@ public Hunt() {
.build()
);

private final Setting<Boolean> onGround = sgGeneral.add(new BoolSetting.Builder()
.name("On ground only")
.description("Attack entities on ground only")
.defaultValue(false)
.build()
);

private final Setting<Boolean> customCheck = sgGeneral.add(new BoolSetting.Builder()
.name("Custom on ground check")
.description("Use a custom on ground check instead of the usual entity.isOnGround. Useful on some servers")
.defaultValue(false)
.build()
);

private boolean entityCheck(Entity entity) {
if (entity.equals(mc.player) || entity.equals(mc.cameraEntity)) return false;
if ((entity instanceof LivingEntity && ((LivingEntity) entity).isDead()) || !entity.isAlive()) return false;
Expand All @@ -54,7 +74,19 @@ private boolean entityCheck(Entity entity) {
return false;
}
}
if (onGround.get()) {
if (customCheck.get()) {
World world = entity.getWorld();

Vec3d entityPos = entity.getPos();
BlockPos posBelow = new BlockPos((int) entityPos.x, (int) (entityPos.y - 1), (int) entityPos.z);

Block blockBelow = world.getBlockState(posBelow).getBlock();

return (blockBelow != Blocks.AIR && blockBelow != Blocks.WATER && blockBelow != Blocks.LAVA);
}
else return entity.isOnGround();
}
return true;
}
private final ArrayList<Entity> targets = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void onMessageRecieve(ReceiveMessageEvent event) {
} catch (InterruptedException e) {
e.printStackTrace();
}
Accept(nickname, pattern, message);
Accept(nickname, custom, message);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import static meteordevelopment.meteorclient.systems.modules.render.BetterTooltips.ECHEST_COLOR;

@Mixin(value = BetterTooltips.class)
@Mixin(value = BetterTooltips.class, remap = false)
public class BetterTooltipsMixin extends Module {
@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Mixin(value = meteordevelopment.meteorclient.utils.misc.Keybind.class, remap = false)
public class KeybindMixin {
@Inject(method = "canBindTo", at = @At("HEAD"), cancellable = true)
public void canBind(boolean isKey, int value, int modifers, CallbackInfoReturnable<Boolean> cir) {
public void canBind(boolean isKey, int value, int modifiers, CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(true);
}
}