Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 745a49b

Browse files
authored
Merge pull request #291 from 3arthqu4ke/v.1.8.5
V.1.8.5
2 parents 261d106 + 57b0723 commit 745a49b

43 files changed

Lines changed: 698 additions & 147 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gradle-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Gradle Build
22

33
on:
44
push:
5+
workflow_dispatch:
56
pull_request:
67
types: [opened, reopened]
78

src/main/java/me/earth/earthhack/forge/mixins/minecraftforge/MixinFMLClientHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
99

1010
@Mixin(value = FMLClientHandler.class, remap = false)
11-
public class MixinFMLClientHandler {
11+
public abstract class MixinFMLClientHandler {
1212
@Inject(
1313
method = "finishMinecraftLoading",
1414
at = @At(

src/main/java/me/earth/earthhack/forge/mixins/minecraftforge/MixinGameData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.util.List;
1515

1616
@Mixin(value = GameData.class, remap = false)
17-
public class MixinGameData
17+
public abstract class MixinGameData
1818
{
1919
private static final SettingCache
2020
<Boolean, BooleanSetting, Management> IGNORE =

src/main/java/me/earth/earthhack/impl/core/mixins/block/ITileEntity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
@Mixin(TileEntity.class)
99
public interface ITileEntity
1010
{
11-
@Accessor(value = "blockType")
12-
Block getBlockType();
13-
1411
@Accessor(value = "blockType")
1512
void setBlockType(Block block);
1613
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package me.earth.earthhack.impl.core.mixins.block;
2+
3+
import me.earth.earthhack.api.cache.ModuleCache;
4+
import me.earth.earthhack.impl.modules.Caches;
5+
import me.earth.earthhack.impl.modules.movement.avoid.Avoid;
6+
import net.minecraft.block.*;
7+
import net.minecraft.block.state.IBlockState;
8+
import net.minecraft.client.Minecraft;
9+
import net.minecraft.util.math.AxisAlignedBB;
10+
import net.minecraft.util.math.BlockPos;
11+
import net.minecraft.world.IBlockAccess;
12+
import net.minecraft.world.World;
13+
import org.spongepowered.asm.mixin.Mixin;
14+
import org.spongepowered.asm.mixin.injection.At;
15+
import org.spongepowered.asm.mixin.injection.Inject;
16+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17+
18+
@Mixin({
19+
Block.class,
20+
BlockAir.class,
21+
BlockFire.class,
22+
BlockCactus.class,
23+
BlockLiquid.class
24+
})
25+
public abstract class MixinAvoid {
26+
private static final ModuleCache<Avoid> AVOID =
27+
Caches.getModule(Avoid.class);
28+
private final Minecraft mc = Minecraft.getMinecraft();
29+
30+
@Inject(
31+
method = "getCollisionBoundingBox",
32+
at = @At("HEAD"),
33+
cancellable = true)
34+
private void getCollisionBoundingBoxHook(IBlockState blockState,
35+
IBlockAccess worldIn,
36+
BlockPos pos,
37+
CallbackInfoReturnable<AxisAlignedBB> cir) {
38+
World world = mc.world;
39+
if (world != null
40+
&& AVOID.isEnabled()
41+
&& !(worldIn instanceof World && !((World) worldIn).isRemote)
42+
&& AVOID.get().check(pos, world)) {
43+
// offset based on the BB instead?
44+
cir.setReturnValue(Block.FULL_BLOCK_AABB);
45+
}
46+
}
47+
48+
}

src/main/java/me/earth/earthhack/impl/core/mixins/render/chunk/MixinVisGraph.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,44 @@
22

33
import me.earth.earthhack.api.cache.ModuleCache;
44
import me.earth.earthhack.impl.modules.Caches;
5+
import me.earth.earthhack.impl.modules.player.freecam.Freecam;
6+
import me.earth.earthhack.impl.modules.player.spectate.Spectate;
57
import me.earth.earthhack.impl.modules.render.xray.XRay;
68
import me.earth.earthhack.impl.modules.render.xray.mode.XrayMode;
79
import net.minecraft.client.renderer.chunk.VisGraph;
10+
import net.minecraft.util.EnumFacing;
811
import net.minecraft.util.math.BlockPos;
912
import org.spongepowered.asm.mixin.Mixin;
1013
import org.spongepowered.asm.mixin.injection.At;
1114
import org.spongepowered.asm.mixin.injection.Inject;
1215
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17+
18+
import java.util.EnumSet;
19+
import java.util.Set;
1320

1421
@Mixin(VisGraph.class)
1522
public abstract class MixinVisGraph
1623
{
17-
private static final ModuleCache<XRay> XRAY = Caches.getModule(XRay.class);
24+
private static final ModuleCache<XRay> XRAY =
25+
Caches.getModule(XRay.class);
26+
private static final ModuleCache<Freecam> FREECAM =
27+
Caches.getModule(Freecam.class);
28+
private static final ModuleCache<Spectate> SPECTATE =
29+
Caches.getModule(Spectate.class);
30+
31+
@Inject(
32+
method = "getVisibleFacings",
33+
at = @At("HEAD"),
34+
cancellable = true)
35+
public void getVisibleFacingsHook(
36+
CallbackInfoReturnable<Set<EnumFacing>> cir)
37+
{
38+
if (FREECAM.isEnabled() || SPECTATE.isEnabled())
39+
{
40+
cir.setReturnValue(EnumSet.allOf(EnumFacing.class));
41+
}
42+
}
1843

1944
@Inject(
2045
method = "setOpaqueCube",

src/main/java/me/earth/earthhack/impl/managers/client/ModuleManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
import me.earth.earthhack.impl.modules.movement.anchor.Anchor;
9292
import me.earth.earthhack.impl.modules.movement.antimove.NoMove;
9393
import me.earth.earthhack.impl.modules.movement.autosprint.AutoSprint;
94+
import me.earth.earthhack.impl.modules.movement.avoid.Avoid;
9495
import me.earth.earthhack.impl.modules.movement.blocklag.BlockLag;
9596
import me.earth.earthhack.impl.modules.movement.boatfly.BoatFly;
9697
import me.earth.earthhack.impl.modules.movement.elytraflight.ElytraFlight;
@@ -109,6 +110,7 @@
109110
import me.earth.earthhack.impl.modules.movement.reversestep.ReverseStep;
110111
import me.earth.earthhack.impl.modules.movement.safewalk.SafeWalk;
111112
import me.earth.earthhack.impl.modules.movement.speed.Speed;
113+
import me.earth.earthhack.impl.modules.movement.stairs.Stairs;
112114
import me.earth.earthhack.impl.modules.movement.step.Step;
113115
import me.earth.earthhack.impl.modules.movement.tickshift.TickShift;
114116
import me.earth.earthhack.impl.modules.movement.velocity.Velocity;
@@ -269,6 +271,7 @@ public void init()
269271

270272
this.forceRegister(new Anchor());
271273
this.forceRegister(new AutoSprint());
274+
this.forceRegister(new Avoid());
272275
this.forceRegister(new BlockLag());
273276
this.forceRegister(new BoatFly());
274277
this.forceRegister(new ElytraFlight());
@@ -288,6 +291,7 @@ public void init()
288291
this.forceRegister(new Phase());
289292
this.forceRegister(new SafeWalk());
290293
this.forceRegister(new Speed());
294+
this.forceRegister(new Stairs());
291295
this.forceRegister(new Step());
292296
this.forceRegister(new TickShift());
293297
this.forceRegister(new Velocity());

src/main/java/me/earth/earthhack/impl/modules/client/hud/HUD.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import me.earth.earthhack.impl.util.render.ColorUtil;
2525
import me.earth.earthhack.impl.util.text.ChatUtil;
2626
import me.earth.earthhack.impl.util.text.TextColor;
27+
import me.earth.earthhack.pingbypass.modules.PbModule;
2728
import net.minecraft.block.material.Material;
2829
import net.minecraft.client.Minecraft;
2930
import net.minecraft.client.entity.EntityPlayerSP;
@@ -308,7 +309,16 @@ protected void renderModules() {
308309
if (isArrayMember(module.getValue()))
309310
continue;
310311
getArrayEntries().put(module.getValue(), new ArrayEntry(module.getValue()));
312+
if (!(module.getValue() instanceof PbModule)) {
313+
getArrayEntries()
314+
.entrySet()
315+
.removeIf(m -> m.getKey() instanceof PbModule
316+
&& Objects.equals(
317+
((PbModule) m.getKey()).getModule(),
318+
module.getValue()));
319+
}
311320
}
321+
312322
Map<Module, ArrayEntry> arrayEntriesSorted;
313323
if (renderModules.getValue() == Modules.Length) {
314324
arrayEntriesSorted = getArrayEntries().entrySet().stream().sorted(Comparator.comparingDouble(entry -> Managers.TEXT.getStringWidth(ModuleUtil.getHudName(entry.getKey())) * -1)).collect(Collectors.toMap(
@@ -406,7 +416,10 @@ public Map<Module, ArrayEntry> getRemoveEntries() {
406416
}
407417

408418
protected boolean isArrayMember(Module module) {
409-
return getArrayEntries().containsKey(module);
419+
return getArrayEntries().containsKey(module)
420+
|| module instanceof PbModule
421+
&& getArrayEntries().containsKey(((PbModule) module)
422+
.getModule());
410423
}
411424

412425
}

src/main/java/me/earth/earthhack/impl/modules/combat/autocrystal/AbstractCalculation.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,17 @@ protected boolean placeNoAntiTotem(PlaceData data, MineSlots liquid)
807807
PositionData firstData = null;
808808
for (PositionData d : data.getData())
809809
{
810+
if (module.override.getValue()
811+
&& d.getSelfDamage() > module.maxSelfPlace.getValue()
812+
&& d.getMaxDamage() < d.getHealth()
813+
|| module.efficientPlacements.getValue()
814+
&& d.getMaxDamage() < d.getSelfDamage()
815+
&& (!module.override.getValue()
816+
|| d.getMaxDamage() < d.getHealth()))
817+
{
818+
continue;
819+
}
820+
810821
if (d.isBlocked())
811822
{
812823
if (maxBlockedDamage < d.getMaxDamage())

src/main/java/me/earth/earthhack/impl/modules/combat/autocrystal/AutoCrystal.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public class AutoCrystal extends Module
118118
protected final Setting<Integer> slowPlaceDelay =
119119
register(new NumberSetting<>("SlowPlaceDelay", 500, 0, 500))
120120
.setComplexity(Complexity.Medium);
121-
protected final Setting<Boolean> override = // TODO: Isnt implemented properly
121+
protected final Setting<Boolean> override =
122122
register(new BooleanSetting("OverridePlace", false))
123123
.setComplexity(Complexity.Expert);
124124
protected final Setting<Boolean> newVer =
@@ -172,6 +172,9 @@ public class AutoCrystal extends Module
172172
protected final Setting<Boolean> ignoreNonFull =
173173
register(new BooleanSetting("IgnoreNonFull", false))
174174
.setComplexity(Complexity.Expert);
175+
protected final Setting<Boolean> efficientPlacements =
176+
register(new BooleanSetting("EfficientPlacements", false))
177+
.setComplexity(Complexity.Expert);
175178
protected final Setting<Integer> simulatePlace =
176179
register(new NumberSetting<>("Simulate-Place", 0, 0, 10))
177180
.setComplexity(Complexity.Medium);

0 commit comments

Comments
 (0)