Skip to content

Commit

Permalink
1.0.1 - Added Vertical Clip related commands. Improved Vertical Clip.
Browse files Browse the repository at this point in the history
  • Loading branch information
areanimika committed Mar 1, 2024
1 parent 36d4118 commit 3b93323
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 24 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# AreanimikaHax
A meteor client addon for 1.20.4

## Features (as of 1.0.0)
- Vertical Clip (module) - Lets you vertically teleport through anything, by right clicking UP/DOWN side of a block. Should not deal fall damage.
- Always No Fall Packet (module) - Maybe (?) better then normal No Fall.
## Features (as of 1.0.1)
- Vertical Clip (module) - Lets you vertically teleport through anything, by right-clicking on a vertical side of a block. Should not deal fall damage.
- Always No Fall Packet (module) - Maybe (?) better than normal No Fall.
- Block Logger (module) (idea by matteipis) - Logs found selected blocks into a file, on chunk load.
- Kill Effects (module) (idea by Umnyasha) - Some effects when you kill entities.
- .svclip <blocks> (command) Lets you vertically teleport through anything, by typing a command. Unlike normal .vclip this should also prevent fall damage.
- .ihclip <blocks> <atATime> (command) The same as .hclip, but lets you teleport more blocks at a time, by splitting the teleportation into multiple packets.
- .top (command) (also .up) Same as Vertical Clip upwards, but a command.
- .bottom (command) (also .down) Same as Vertical Clip downwards, but a command.

## Discord
https://discord.gg/MMbWUmjGKg Join to suggest a feature, or just talk
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.20.4+build.3
loader_version=0.15.7

# Mod Properties
mod_version=1.0.0
mod_version=1.0.1
maven_group=com.areanimika
archives_base_name=areanimikahax

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/areanimika/areanimikahax/Addon.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.areanimika.areanimikahax;

import com.areanimika.areanimikahax.commands.BottomCommand;
import com.areanimika.areanimikahax.commands.IncHClipCommand;
import com.areanimika.areanimikahax.commands.SafeVClipCommand;
import com.areanimika.areanimikahax.commands.TopCommand;
import com.areanimika.areanimikahax.modules.AlwaysNoFallPacket;
import com.areanimika.areanimikahax.modules.BlockLogger;
import com.areanimika.areanimikahax.modules.KillEffects;
Expand All @@ -26,6 +28,8 @@ public void onInitialize() {

Commands.add(new SafeVClipCommand());
Commands.add(new IncHClipCommand());
Commands.add(new TopCommand());
Commands.add(new BottomCommand());
}

@Override public void onRegisterCategories() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.areanimika.areanimikahax.commands;

import com.areanimika.areanimikahax.utils.MovementUtils;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;

public class BottomCommand extends Command {
public BottomCommand() {
super("bottom", "Same as Vertical Clip downwards, but a command.", "down");
}

@Override public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
Double d = MovementUtils.findVClipTeleportationDifference(mc.player.getY(), true);
if(d != null) MovementUtils.saferVClip(d);
else error("Couldn't find a point to teleport to.");

return SINGLE_SUCCESS;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.areanimika.areanimikahax.commands;

import com.areanimika.areanimikahax.utils.MovementUtils;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;

public class TopCommand extends Command {
public TopCommand() {
super("top", "Same as Vertical Clip upwards, but a command.", "up");
}

@Override public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
Double d = MovementUtils.findVClipTeleportationDifference(mc.player.getY(), false);
if(d != null) MovementUtils.saferVClip(d);
else error("Couldn't find a point to teleport to.");

return SINGLE_SUCCESS;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void onRender(Render3DEvent event) {
if (shape.isEmpty()) return;
Box box = shape.getBoundingBox();

Double difference = findDifference(bp.getY(), side == Direction.UP);
Double difference = MovementUtils.findVClipTeleportationDifference(mc.player.getY(), side == Direction.UP);

if(difference != null && Math.abs(difference) <= maxDistance.get())
event.renderer.sideHorizontal(bp.getX() + box.minX, bp.getY() + (side == Direction.DOWN ? box.minY : box.maxY), bp.getZ() + box.minZ, bp.getX() + box.maxX, bp.getZ() + box.maxZ, sideColor.get(), lineColor.get(), shapeMode.get());
Expand All @@ -100,31 +100,14 @@ public void onClick(InteractBlockEvent event) {
if(onlyOnKeyEnabled.get() && !(onlyOnKeyKeybind.get().isPressed() && onlyOnKeyKeybind.get().isValid())) return;
if(event.result.isInsideBlock()) return;

BlockPos bp = event.result.getBlockPos();
Direction side = event.result.getSide();
if (side != Direction.UP && side != Direction.DOWN) return;

Double difference = findDifference(bp.getY(), side == Direction.UP);
Double difference = MovementUtils.findVClipTeleportationDifference(mc.player.getY(), side == Direction.UP);
if(difference == null) return;
if(Math.abs(difference) > maxDistance.get()) return;

MovementUtils.saferVClip(difference);
}

private Double findDifference(int originY, boolean up) {
if(up) {
// | Can't use maxDistance here, because then it could TP into the void.
for (int y = originY; y >= mc.world.getBottomY(); y--) {
double diffHere = y - mc.player.getY();
if(MovementUtils.isPlayerNotCollidingWithBlocksVertically(mc.player.getY() + diffHere)) return diffHere;
}
} else {
for(int y = originY; y <= originY + maxDistance.get(); y++) {
double diffHere = y - mc.player.getY();
if(MovementUtils.isPlayerNotCollidingWithBlocksVertically(mc.player.getY() + diffHere)) return diffHere;
}
}

return null;
event.cancel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,36 @@ public static boolean isPlayerNotCollidingWithBlocksVertically(double newY) {

return true;
}

public static Double findVClipTeleportationDifference(double originY, boolean goDown) {
boolean hadAnyObstaclesYet = false;

if(goDown) {
for (double y = originY; y >= mc.world.getBottomY(); y--) {
double diffHere = y - mc.player.getY();

if(isPlayerNotCollidingWithBlocksVertically(mc.player.getY() + diffHere)) {
if (hadAnyObstaclesYet) {
return diffHere;
}
} else {
hadAnyObstaclesYet = true;
}
}
} else {
for(double y = originY; y <= mc.world.getTopY() + 2; y++) {
double diffHere = y - mc.player.getY();

if(isPlayerNotCollidingWithBlocksVertically(mc.player.getY() + diffHere)) {
if (hadAnyObstaclesYet) {
return diffHere;
}
} else {
hadAnyObstaclesYet = true;
}
}
}

return null;
}
}

0 comments on commit 3b93323

Please sign in to comment.