Skip to content

Commit 544f21c

Browse files
authored
Merge pull request #36 from Dasupergrasskakjd/1.21.8
Fixes and new feature
2 parents 92de495 + 021f63f commit 544f21c

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

src/main/java/nekiplay/meteorplus/features/modules/combat/Hunt.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import meteordevelopment.meteorclient.events.world.TickEvent;
44
import meteordevelopment.meteorclient.pathing.PathManagers;
5+
import meteordevelopment.meteorclient.settings.BoolSetting;
56
import meteordevelopment.meteorclient.settings.EntityTypeListSetting;
67
import meteordevelopment.meteorclient.settings.Setting;
78
import meteordevelopment.meteorclient.settings.SettingGroup;
@@ -12,11 +13,16 @@
1213
import meteordevelopment.meteorclient.utils.entity.SortPriority;
1314
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
1415
import meteordevelopment.orbit.EventHandler;
16+
import net.minecraft.block.Block;
17+
import net.minecraft.block.Blocks;
1518
import net.minecraft.entity.Entity;
1619
import net.minecraft.entity.EntityType;
1720
import net.minecraft.entity.LivingEntity;
1821
import net.minecraft.entity.Tameable;
1922
import net.minecraft.entity.player.PlayerEntity;
23+
import net.minecraft.util.math.BlockPos;
24+
import net.minecraft.util.math.Vec3d;
25+
import net.minecraft.world.World;
2026

2127
import java.util.ArrayList;
2228
import java.util.Set;
@@ -35,6 +41,20 @@ public Hunt() {
3541
.build()
3642
);
3743

44+
private final Setting<Boolean> onGround = sgGeneral.add(new BoolSetting.Builder()
45+
.name("On ground only")
46+
.description("Attack entities on ground only")
47+
.defaultValue(false)
48+
.build()
49+
);
50+
51+
private final Setting<Boolean> customCheck = sgGeneral.add(new BoolSetting.Builder()
52+
.name("Custom on ground check")
53+
.description("Use a custom on ground check instead of the usual entity.isOnGround. Useful on some servers")
54+
.defaultValue(false)
55+
.build()
56+
);
57+
3858
private boolean entityCheck(Entity entity) {
3959
if (entity.equals(mc.player) || entity.equals(mc.cameraEntity)) return false;
4060
if ((entity instanceof LivingEntity && ((LivingEntity) entity).isDead()) || !entity.isAlive()) return false;
@@ -54,7 +74,19 @@ private boolean entityCheck(Entity entity) {
5474
return false;
5575
}
5676
}
77+
if (onGround.get()) {
78+
if (customCheck.get()) {
79+
World world = entity.getWorld();
80+
81+
Vec3d entityPos = entity.getPos();
82+
BlockPos posBelow = new BlockPos((int) entityPos.x, (int) (entityPos.y - 1), (int) entityPos.z);
83+
84+
Block blockBelow = world.getBlockState(posBelow).getBlock();
5785

86+
return (blockBelow != Blocks.AIR && blockBelow != Blocks.WATER && blockBelow != Blocks.LAVA);
87+
}
88+
else return entity.isOnGround();
89+
}
5890
return true;
5991
}
6092
private final ArrayList<Entity> targets = new ArrayList<>();

src/main/java/nekiplay/meteorplus/features/modules/misc/AutoAccept.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void onMessageRecieve(ReceiveMessageEvent event) {
151151
} catch (InterruptedException e) {
152152
e.printStackTrace();
153153
}
154-
Accept(nickname, pattern, message);
154+
Accept(nickname, custom, message);
155155
}
156156
}
157157
});

src/main/java/nekiplay/meteorplus/mixin/meteorclient/modules/BetterTooltipsMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

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

32-
@Mixin(value = BetterTooltips.class)
32+
@Mixin(value = BetterTooltips.class, remap = false)
3333
public class BetterTooltipsMixin extends Module {
3434
@Shadow
3535
@Final

src/main/java/nekiplay/meteorplus/mixin/meteorclient/utils/misc/KeybindMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@Mixin(value = meteordevelopment.meteorclient.utils.misc.Keybind.class, remap = false)
99
public class KeybindMixin {
1010
@Inject(method = "canBindTo", at = @At("HEAD"), cancellable = true)
11-
public void canBind(boolean isKey, int value, int modifers, CallbackInfoReturnable<Boolean> cir) {
11+
public void canBind(boolean isKey, int value, int modifiers, CallbackInfoReturnable<Boolean> cir) {
1212
cir.setReturnValue(true);
1313
}
1414
}

0 commit comments

Comments
 (0)