Skip to content

Commit

Permalink
1.19.4 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanicblock61 committed Apr 22, 2023
1 parent 07cf239 commit 6bf9a6d
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 29 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/versions.html)
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.2
loader_version=0.14.11
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.19

# Mod Properties
mod_version=0.1
Expand All @@ -13,4 +13,4 @@ archives_base_name=reaper
# Dependency Versions

# Meteor (https://maven.meteordev.org/)
meteor_version=0.5.2
meteor_version=0.5.3
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import meteordevelopment.meteorclient.utils.render.color.RainbowColor;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
import meteordevelopment.meteorclient.mixin.ClientPlayerEntityAccessor;
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void doCraft(ScreenHandler h) {
List<RecipeResultCollection> recipeResultCollectionList = mc.player.getRecipeBook().getResultsForGroup(RecipeBookGroup.CRAFTING_MISC);
for (RecipeResultCollection recipeResultCollection : recipeResultCollectionList) {
for (Recipe<?> recipe : recipeResultCollection.getRecipes(true)) {
if (recipe.getOutput().getItem() instanceof BedItem) { // find bed recipe (matches to whatever wool/planks you have)
if (recipe.getOutput(mc.world.getRegistryManager()).getItem() instanceof BedItem) { // find bed recipe (matches to whatever wool/planks you have)
assert mc.interactionManager != null;
mc.interactionManager.clickRecipe(h.syncId, recipe, false); // click the recipe
Interactions.windowClick(h, 0, SlotActionType.QUICK_MOVE, 1); // pick up the result and move to our inventory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void reset() {
charged = false;
moved = false;

if (step.get()) mc.player.stepHeight = 0.5f;
if (step.get()) mc.player.setStepHeight(0.5f);
}

@EventHandler
Expand Down Expand Up @@ -127,7 +127,7 @@ private void onTick(TickEvent.Pre event) {

if (moved) {
durationTicked++;
if (step.get()) mc.player.stepHeight = stepHeight.get().floatValue();
if (step.get()) mc.player.setStepHeight(stepHeight.get().floatValue());
}
}
if (startPos != null && (Math.sqrt(mc.player.squaredDistanceTo(startPos)) >= distance.get() || (durationTicked * factor.get()) > durationTicks.get())) toggle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ private void onReceivePacket(PacketEvent.Receive event) {
}

@EventHandler
private void onSentPacket(PacketEvent.Sent event) {
private void onSentPacket(PacketEvent.Send event) {
if (!(event.packet instanceof TeleportConfirmC2SPacket packet)) return;

if (packet.getTeleportId() == tel) {
tel = -1;

event.cancel();
} else vec = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.item.*;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket;
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
import net.minecraft.network.packet.s2c.play.PositionFlag;
import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3i;
Expand All @@ -35,6 +36,7 @@
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -462,8 +464,8 @@ public void onReceivePacket(PacketEvent.Receive event) {

((PlayerPositionLookS2CPacketAccessor) event.packet).setYaw(mc.player.getYaw());
((PlayerPositionLookS2CPacketAccessor) event.packet).setPitch(mc.player.getPitch());
packet.getFlags().remove(PlayerPositionLookS2CPacket.Flag.X_ROT);
packet.getFlags().remove(PlayerPositionLookS2CPacket.Flag.Y_ROT);
packet.getFlags().remove(PositionFlag.X_ROT);
packet.getFlags().remove(PositionFlag.Y_ROT);
teleportId = packet.getTeleportId();
} else {
teleportId = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public class ElytraBotThreaded extends ReaperModule {
private int x, z;
private int startingTotems;
private boolean watchTotems;
private double jumpY = -1;
private int jumpY = -1;
private int packetsSent, lagbackCounter, useBaritoneCounter;
private boolean lagback, toggledNoFall, isRunning;
private double blocksPerSecond;
Expand Down Expand Up @@ -319,7 +319,7 @@ public void onActivate() {
else {
x = gotoX.get();
z = gotoZ.get();
goal = new BlockPos(x, mc.player.getY() + up, z);
goal = new BlockPos(x, (int)mc.player.getY() + up, z);
Goal = ("X: " + x + ", Z: " + z);
}

Expand Down Expand Up @@ -517,7 +517,7 @@ public void loop() {
fireworkTimer.ms = 0;

if (mc.player.isOnGround()) {
jumpY = mc.player.getY();
jumpY = (int)mc.player.getY();
generatePath();
mc.player.jump();
if (debug.get()) info("Path generated, taking off.");
Expand Down Expand Up @@ -677,7 +677,7 @@ else if (!PacketFly.toggled) {
}

if (flyMode.get() == FlyMode.Firework) {
Vec3d vec = new Vec3d(path.get(path.size() - 1).add(0.5, 0.5, 0.5).getX(), path.get(path.size() - 1).add(0.5, 0.5, 0.5).getY(), path.get(path.size() - 1).add(0.5, 0.5, 0.5).getZ());
Vec3d vec = new Vec3d(path.get(path.size() - 1).add(1, 1, 1).getX(), path.get(path.size() - 1).add(1, 1, 1).getY(), path.get(path.size() - 1).add(1, 1, 1).getZ());
mc.player.setYaw((float) Rotations.getYaw(vec));
mc.player.setPitch((float) Rotations.getPitch(vec));
if (debug.get()) info("Rotating to use firework.");
Expand Down Expand Up @@ -733,7 +733,7 @@ else if (botMode.get() == Mode.Tunnel) {
if (botMode.get() == Mode.Overworld) {
start = getPlayerPos().add(0, 4, 0);
} else if (Math.abs(jumpY - mc.player.getY()) <= 2) {
start = new BlockPos(mc.player.getX(), jumpY + 1, mc.player.getZ());
start = new BlockPos((int)mc.player.getX(), jumpY + 1, (int)mc.player.getZ());
} else {
start = getPlayerPos().add(0, 1, 0);
}
Expand Down Expand Up @@ -854,9 +854,9 @@ private void clickOnFirework() {
public BlockPos generateGoalFromDirection(DirectionUtil direction, int up) {
// since we call mc.player.getX/Y/Z multiple times we should just have them as variables
// and use those
double x = mc.player.getX();
double y = mc.player.getY();
double z = mc.player.getZ();
int x = (int)mc.player.getX();
int y = (int)mc.player.getY();
int z = (int)mc.player.getZ();
if (direction == DirectionUtil.ZM) {
return new BlockPos(0, y + up, z - 30000000);
} else if (direction == DirectionUtil.ZP) {
Expand All @@ -877,7 +877,7 @@ public BlockPos generateGoalFromDirection(DirectionUtil direction, int up) {
}

private BlockPos getPlayerPos() {
return new BlockPos(mc.player.getX(), mc.player.getY(), mc.player.getZ());
return new BlockPos((int)mc.player.getX(), (int)mc.player.getY(), (int)mc.player.getZ());
}

private void walkTo(BlockPos goal, boolean sleepUntilDone) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/ghosttypes/reaper/util/misc/MathUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public static Vec3d getVelocity(PlayerEntity player) {
public static BlockPos offsetByVelocity(BlockPos pos, PlayerEntity player) {
if (pos == null || player == null) return null;
Vec3d velocity = getVelocity(player);
return pos.add(velocity.x, velocity.y, velocity.z);
return pos.add((int)velocity.x, (int)velocity.y, (int)velocity.z);
}

public static BlockPos generatePredict(BlockPos pos, PlayerEntity player, int ticks) {
if (pos == null || player == null) return null;
Vec3d velocity = getVelocity(player);
Vec3i v = new Vec3i(velocity.x * ticks, velocity.y * ticks, velocity.z * ticks);
Vec3i v = new Vec3i((int)velocity.x * ticks, (int)velocity.y * ticks, (int)velocity.z * ticks);
return pos.add(v);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import meteordevelopment.meteorclient.utils.player.FindItemResult;
import meteordevelopment.meteorclient.utils.player.Rotations;
import net.minecraft.entity.Entity;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.c2s.play.*;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum SurroundDesign {
public static boolean isVecListComplete(ArrayList<Vec3d> vlist) {
if (vlist == null || vlist.isEmpty()) return false;
BlockPos ppos = mc.player.getBlockPos();
for (Vec3d b: vlist) if (BlockHelper.canPlace(ppos.add(b.x, b.y, b.z))) return false;
for (Vec3d b: vlist) if (BlockHelper.canPlace(ppos.add((int)b.x, (int)b.y, (int)b.z))) return false;
return true;
}

Expand All @@ -34,7 +34,7 @@ public static boolean isBlockListComplete(ArrayList<BlockPos> blist) {
public static ArrayList<BlockPos> vecToPos(BlockPos center, ArrayList<Vec3d> vlist) {
ArrayList<BlockPos> blocks = new ArrayList<>();
for (Vec3d v : vlist) {
BlockPos p = center.add(v.x, v.y, v.z);
BlockPos p = center.add((int)v.x, (int)v.y, (int)v.z);
blocks.add(p);
}
return blocks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static Vector3d vec3(BlockPos pos) {
return new Vector3d().set(pos.getX(), pos.getY(), pos.getZ());
}
public static Vec3d vec3d(BlockPos pos) {return new Vec3d(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D);}
public static Vec3i vec3i(BlockPos pos) {return new Vec3i(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D);}
public static Vec3i vec3i(Vec3d pos) {return new Vec3i(pos.getX(), pos.getY(), pos.getZ());}
public static Vec3i vec3i(BlockPos pos) {return new Vec3i(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);}
public static Vec3i vec3i(Vec3d pos) {return new Vec3i((int) pos.getX(), (int) pos.getY(), (int) pos.getZ());}

public static boolean isHole(BlockPos p) {
for (CardinalDirection cd : CardinalDirection.values()) if (isAir(p.offset(cd.toDirection()))) return false;
Expand Down

0 comments on commit 6bf9a6d

Please sign in to comment.