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

Commit

Permalink
Merge pull request #198 from 3arthqu4ke/v1.8.2
Browse files Browse the repository at this point in the history
[1.8.2] SwordGapOverride, Shader fix, CustomShader for Chams, AutoCrystal Extrapolation improvements
  • Loading branch information
3arthqu4ke authored Sep 1, 2022
2 parents 7a7f14d + b8f3ca7 commit 75a424f
Show file tree
Hide file tree
Showing 20 changed files with 369 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,28 @@ public class ModelRenderEvent extends Event
private final RenderLivingBase<?> renderLiving;
private final EntityLivingBase entity;
private final ModelBase model;
private final float limbSwing;
private final float limbSwingAmount;
private final float ageInTicks;
private final float netHeadYaw;
private final float headPitch;
private final float scale;

private ModelRenderEvent(RenderLivingBase<?> renderLiving,
EntityLivingBase entity,
ModelBase model)
ModelBase model, float limbSwing,
float limbSwingAmount, float ageInTicks,
float netHeadYaw, float headPitch, float scale)
{
this.renderLiving = renderLiving;
this.entity = entity;
this.model = model;
this.limbSwing = limbSwing;
this.limbSwingAmount = limbSwingAmount;
this.ageInTicks = ageInTicks;
this.netHeadYaw = netHeadYaw;
this.headPitch = headPitch;
this.scale = scale;
}

public RenderLivingBase<?> getRenderLiving()
Expand All @@ -35,15 +49,38 @@ public ModelBase getModel()
return model;
}

public static class Pre extends ModelRenderEvent
public float getLimbSwing()
{
return limbSwing;
}

public float getLimbSwingAmount()
{
return limbSwingAmount;
}

public float getAgeInTicks()
{
return ageInTicks;
}

public float getNetHeadYaw()
{
return netHeadYaw;
}

public float getHeadPitch()
{
return headPitch;
}

public float getScale()
{
private final float limbSwing;
private final float limbSwingAmount;
private final float ageInTicks;
private final float netHeadYaw;
private final float headPitch;
private final float scale;
return scale;
}

public static class Pre extends ModelRenderEvent
{
public Pre(RenderLivingBase<?> renderLiving,
EntityLivingBase entity,
ModelBase model,
Expand All @@ -54,55 +91,13 @@ public Pre(RenderLivingBase<?> renderLiving,
float headPitch,
float scale)
{
super(renderLiving, entity, model);
this.limbSwing = limbSwing;
this.limbSwingAmount = limbSwingAmount;
this.ageInTicks = ageInTicks;
this.netHeadYaw = netHeadYaw;
this.headPitch = headPitch;
this.scale = scale;
}

public float getLimbSwing()
{
return limbSwing;
}

public float getLimbSwingAmount()
{
return limbSwingAmount;
}

public float getAgeInTicks()
{
return ageInTicks;
}

public float getNetHeadYaw()
{
return netHeadYaw;
}

public float getHeadPitch()
{
return headPitch;
}

public float getScale()
{
return scale;
super(renderLiving, entity, model, limbSwing, limbSwingAmount,
ageInTicks, netHeadYaw, headPitch, scale);
}
}

public static class Post extends ModelRenderEvent
{
private final float limbSwing;
private final float limbSwingAmount;
private final float ageInTicks;
private final float netHeadYaw;
private final float headPitch;
private final float scale;

public Post(RenderLivingBase<?> renderLiving,
EntityLivingBase entity,
ModelBase model,
Expand All @@ -113,43 +108,8 @@ public Post(RenderLivingBase<?> renderLiving,
float headPitch,
float scale)
{
super(renderLiving, entity, model);
this.limbSwing = limbSwing;
this.limbSwingAmount = limbSwingAmount;
this.ageInTicks = ageInTicks;
this.netHeadYaw = netHeadYaw;
this.headPitch = headPitch;
this.scale = scale;
}

public float getLimbSwing()
{
return limbSwing;
}

public float getLimbSwingAmount()
{
return limbSwingAmount;
}

public float getAgeInTicks()
{
return ageInTicks;
}

public float getNetHeadYaw()
{
return netHeadYaw;
}

public float getHeadPitch()
{
return headPitch;
}

public float getScale()
{
return scale;
super(renderLiving, entity, model, limbSwing, limbSwingAmount,
ageInTicks, netHeadYaw, headPitch, scale);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import me.earth.earthhack.impl.util.math.MathUtil;
import me.earth.earthhack.impl.util.math.StopWatch;
import me.earth.earthhack.impl.util.minecraft.CooldownBypass;
import me.earth.earthhack.impl.util.minecraft.PushMode;
import me.earth.earthhack.impl.util.minecraft.blocks.BlockUtil;
import me.earth.earthhack.impl.util.minecraft.entity.EntityUtil;
import me.earth.earthhack.impl.util.misc.collections.CollectionUtil;
Expand Down Expand Up @@ -727,17 +726,9 @@ public class AutoCrystal extends Module
public final Setting<Double> breakNormalWeight =
register(new NumberSetting<>("B-Norm-Weight", 1.0, 0.0, 5.0))
.setComplexity(Complexity.Medium);


public final Setting<PushMode> pushOutOfBlocks =
register(new EnumSetting<>("PushOutOfBlocks", PushMode.None))
.setComplexity(Complexity.Expert);
public final Setting<Boolean> shrinkPush =
register(new BooleanSetting("ShrinkPush", false))
.setComplexity(Complexity.Expert);
public final Setting<Boolean> noPushOnNoMove =
register(new BooleanSetting("NoPushOnNoMove", false))
.setComplexity(Complexity.Expert);
public final Setting<Boolean> gravityExtrapolation =
register(new BooleanSetting("Extra-Gravity", true))
.setComplexity(Complexity.Expert);
public final Setting<Boolean> selfExtrapolation =
register(new BooleanSetting("SelfExtrapolation", false))
.setComplexity(Complexity.Medium);
Expand Down Expand Up @@ -786,6 +777,9 @@ public class AutoCrystal extends Module
protected final Setting<Boolean> smartPost =
register(new BooleanSetting("Smart-Post", true))
.setComplexity(Complexity.Medium);
protected final Setting<Boolean> mainThreadThreads =
register(new BooleanSetting("MainThreadThreads", false))
.setComplexity(Complexity.Medium);
protected final Setting<RotationThread> rotationThread =
register(new EnumSetting<>("RotationThread", RotationThread.Predict))
.setComplexity(Complexity.Expert);
Expand Down Expand Up @@ -885,6 +879,9 @@ public class AutoCrystal extends Module
protected final Setting<Boolean> debugAntiPlaceFail =
register(new BooleanSetting("DebugAntiPlaceFail", false))
.setComplexity(Complexity.Expert);
protected final Setting<Boolean> alwaysBomb =
register(new BooleanSetting("Always-Bomb", false))
.setComplexity(Complexity.Expert);
protected final Setting<Integer> removeTime =
register(new NumberSetting<>("Remove-Time", 1000, 0, 2500))
.setComplexity(Complexity.Expert);
Expand Down Expand Up @@ -918,6 +915,7 @@ public class AutoCrystal extends Module
protected final Queue<Runnable> post = new ConcurrentLinkedQueue<>();
protected volatile RotationFunction rotation;
private BlockPos bypassPos;
public BlockPos bombPos;
protected EntityPlayer target;
protected Entity crystal;
protected Entity focus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ListenerBlockChange(AutoCrystal module)
@Override
public void invoke(PacketEvent.Receive<SPacketBlockChange> event)
{
if (module.multiThread.getValue()
if ((module.multiThread.getValue() || module.mainThreadThreads.getValue())
&& module.blockChangeThread.getValue())
{
SPacketBlockChange packet = event.getPacket();
Expand All @@ -29,6 +29,7 @@ public void invoke(PacketEvent.Receive<SPacketBlockChange> event)
event.addPostEvent(() ->
{
if (mc.world != null
&& mc.player != null
&& HelperUtil.validChange(packet.getBlockPosition(),
mc.world.playerEntities))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ public ListenerBlockMulti(AutoCrystal module)
@Override
public void invoke(PacketEvent.Receive<SPacketMultiBlockChange> event)
{
if (module.multiThread.getValue()
if ((module.multiThread.getValue() || module.mainThreadThreads.getValue())
&& module.blockChangeThread.getValue())
{
SPacketMultiBlockChange packet = event.getPacket();
event.addPostEvent(() ->
{
if (mc.world == null || mc.player == null)
{
return;
}

for (SPacketMultiBlockChange.BlockUpdateData data :
packet.getChangedBlocks())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,23 @@ private void onEvent(PacketEvent.Receive<SPacketSpawnObject> event)
entity.setEntityId(packet.getEntityID());
entity.setUniqueId(packet.getUniqueId());

if (!module.alwaysCalc.getValue()
if ((!module.alwaysCalc.getValue()
|| pos.equals(module.bombPos)
&& module.alwaysBomb.getValue())
&& stamp != null
&& stamp.isValid()
&& (stamp.getDamage() > module.slowBreakDamage.getValue()
|| stamp.isShield()
|| module.breakTimer.passed(module.slowBreakDelay.getValue())
|| pos.down().equals(module.antiTotemHelper.getTargetPos())))
{
if (pos.equals(module.bombPos))
{
// should probably set the block underneath
// to air when calcing self damage...
module.bombPos = null;
}

float damage = checkPos(entity);
if (damage <= -1000.0f)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import me.earth.earthhack.impl.modules.combat.autocrystal.AutoCrystal;
import me.earth.earthhack.impl.util.math.rotation.RotationUtil;
import me.earth.earthhack.impl.util.minecraft.MotionTracker;
import me.earth.earthhack.impl.util.minecraft.PushMode;
import me.earth.earthhack.impl.util.minecraft.entity.EntityUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -70,17 +69,9 @@ private void updateTracker(MotionTracker tracker, int ticks) {
}

tracker.active = false;
tracker.shouldPushOutOfBlocks =
(!module.noPushOnNoMove.getValue()
|| tracker.tracked.motionX != 0.0
|| tracker.tracked.motionY != 0.0
|| tracker.tracked.motionZ != 0.0)
? module.pushOutOfBlocks.getValue()
: PushMode.None;
tracker.shrinkPush = module.shrinkPush.getValue();
tracker.copyLocationAndAnglesFrom(tracker.tracked);
tracker.detectWasPhasing();
for (int i = 0; i < ticks; i++) {
tracker.gravity = module.gravityExtrapolation.getValue();
for (tracker.ticks = 0; tracker.ticks < ticks; tracker.ticks++) {
tracker.updateFromTrackedEntity();
}

Expand Down
Loading

0 comments on commit 75a424f

Please sign in to comment.