man cut that shit out 😭
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m7s
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m7s
This commit is contained in:
parent
97def8f472
commit
0d6d3663d1
2 changed files with 0 additions and 144 deletions
|
@ -63,7 +63,6 @@ public class Setup {
|
|||
new SeedOverlay(),
|
||||
new Set(),
|
||||
new Select(),
|
||||
new Speed(),
|
||||
new Spotify(),
|
||||
new SwingSpeed(),
|
||||
new Test(),
|
||||
|
|
|
@ -1,143 +0,0 @@
|
|||
package de.com.baseband.client.feature.movement;
|
||||
|
||||
import de.com.baseband.client.event.events.MoveEvent;
|
||||
import de.com.baseband.client.event.events.PacketEvent;
|
||||
import de.com.baseband.client.feature.Feature;
|
||||
import de.com.baseband.client.feature.Features;
|
||||
import de.com.baseband.client.feature.category.Movement;
|
||||
import de.com.baseband.client.feature.client.Timer;
|
||||
import de.com.baseband.client.mixin.mixins.IMinecraft;
|
||||
import de.com.baseband.client.mixin.mixins.ITimer;
|
||||
import de.com.baseband.client.registry.annotation.Config;
|
||||
import de.com.baseband.client.util.interact.MotionUtil;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.network.play.server.SPacketPlayerPosLook;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
|
||||
//the horror but also not quite "the horror"
|
||||
@Movement
|
||||
public class Speed extends Feature {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Speed";
|
||||
}
|
||||
|
||||
|
||||
@Config("CollideInhibit")
|
||||
public boolean collideInhibit;
|
||||
|
||||
@Config("UseTimer")
|
||||
public boolean useTimer;
|
||||
|
||||
int strafePhase;
|
||||
double playerSpeed;
|
||||
double lastDistance;
|
||||
boolean wasInWater;
|
||||
boolean alternatingHop;
|
||||
|
||||
public void onEnable() {
|
||||
wasInWater = false;
|
||||
}
|
||||
|
||||
public void onDisable() {
|
||||
Features.getFeature(Timer.class).timerLock = false;
|
||||
Features.getFeature(Timer.class).multiplierLock = 20f;
|
||||
}
|
||||
|
||||
public void onMove(MoveEvent event) {
|
||||
if (!collideInhibit && (isInLiquid() || isOnWater(true) || mc.player.isOnLadder() || mc.player.isEntityInsideOpaqueBlock())) {
|
||||
playerSpeed = 0.0;
|
||||
wasInWater = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mc.player.moveForward == 0.0f && mc.player.moveStrafing == 0.0f) {
|
||||
return;
|
||||
}
|
||||
if (strafePhase == 1) {
|
||||
playerSpeed = 1.35 * MotionUtil.applySpeed(0.2873) - 0.01;
|
||||
} else if (strafePhase == 2) {
|
||||
event.y = (mc.player.motionY = 0.3999 + MotionUtil.applyJumpBoost(0.0));
|
||||
playerSpeed *= (alternatingHop ? 1.6835 : 1.395);
|
||||
} else if (strafePhase == 3) {
|
||||
playerSpeed = lastDistance - 0.66 * (lastDistance - MotionUtil.applySpeed(0.2873));
|
||||
alternatingHop = !alternatingHop;
|
||||
} else {
|
||||
if ((!mc.world.getCollisionBoxes(mc.player, mc.player.getEntityBoundingBox().offset(0.0, mc.player.motionY, 0.0)).isEmpty() || mc.player.collidedVertically) && strafePhase > 0) {
|
||||
strafePhase = ((mc.player.moveForward != 0.0f || mc.player.moveStrafing != 0.0f) ? 1 : 0);
|
||||
}
|
||||
playerSpeed = lastDistance - lastDistance / 159.0;
|
||||
}
|
||||
playerSpeed = Math.max(playerSpeed, MotionUtil.applySpeed(0.2873));
|
||||
final double[] dir = MotionUtil.getMotion(playerSpeed);
|
||||
event.x = (dir[0]);
|
||||
event.z = (dir[1]);
|
||||
if (mc.player.moveForward != 0.0f || mc.player.moveStrafing != 0.0f) {
|
||||
++strafePhase;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean isOnWater(boolean bl) {
|
||||
int minY = MathHelper.floor(mc.player.getEntityBoundingBox().minY - (bl ? 0.03 : 0.2));
|
||||
int minX = MathHelper.floor(mc.player.getEntityBoundingBox().minX);
|
||||
int maxX = MathHelper.ceil(mc.player.getEntityBoundingBox().maxX);
|
||||
int minZ = MathHelper.floor(mc.player.getEntityBoundingBox().minZ);
|
||||
int maxZ = MathHelper.ceil(mc.player.getEntityBoundingBox().maxZ);
|
||||
|
||||
for (int x = minX; x < maxX; x++) {
|
||||
for (int z = minZ; z < maxZ; z++) {
|
||||
IBlockState iBlockState = mc.world.getBlockState(new BlockPos(x, minY, z));
|
||||
if (iBlockState.getBlock() instanceof BlockLiquid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isInLiquid() {
|
||||
int minX = MathHelper.floor(mc.player.getEntityBoundingBox().minX);
|
||||
int maxX = MathHelper.ceil(mc.player.getEntityBoundingBox().maxX);
|
||||
int minZ = MathHelper.floor(mc.player.getEntityBoundingBox().minZ);
|
||||
int maxZ = MathHelper.ceil(mc.player.getEntityBoundingBox().maxZ);
|
||||
int minY = MathHelper.floor(mc.player.getEntityBoundingBox().minY + 0.01);
|
||||
|
||||
for (int x = minX; x < maxX; x++) {
|
||||
for (int z = minZ; z < maxZ; z++) {
|
||||
IBlockState iBlockState = mc.world.getBlockState(new BlockPos(x, minY, z));
|
||||
if (iBlockState.getBlock() instanceof BlockLiquid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onPacketReceive(final PacketEvent.Receive event) {
|
||||
if (event.getPacket() instanceof SPacketPlayerPosLook) {
|
||||
playerSpeed = MotionUtil.applySpeed(0.2873);
|
||||
lastDistance = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEveryTick() {
|
||||
if(enabled && !notIngame()) {
|
||||
text = this + "§7 [" + String.format("%.2f", getSpeed()) + " km/h]";
|
||||
} else {
|
||||
Features.getFeature(Timer.class).timerLock = false;
|
||||
Features.getFeature(Timer.class).multiplierLock = 20f;
|
||||
text = toString();
|
||||
}
|
||||
}
|
||||
|
||||
public double getSpeed() {
|
||||
return MathHelper.sqrt(Math.pow(mc.player.posX - mc.player.prevPosX, 2.0f) + Math.pow(mc.player.posZ - mc.player.prevPosZ, 2.0)) / (((ITimer) ((IMinecraft) mc).getTimer()).getTickLength() / 1000.0f) * 3.6;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue