Skip to content

Commit

Permalink
Merge pull request #2 from dkonis/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dkonis authored Nov 25, 2022
2 parents ca5ac91 + beba687 commit ed7678c
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 63 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
[![Minecraft: Fabric](https://img.shields.io/badge/Minecraft-Fabric-green.svg)](https://fabricmc.net)
## Features
- LiveOverflow Bypass - allows you to play in LiveOverflow's Server.
- Flying Hack - let you to fly in Minecraft-Survival.
- XRay Hack - let you to view only valuable blocks.
- Dynamic Teleport Hack - teleports to the player's view direction.
- Flying Hack - let the player fly in Minecraft-Survival.
- No Fall Damage Hack - prevent the player from taking fall damage.
- XRay Hack - let the player view only valuable blocks.
- GigaChad Hack - general status effect bonuses.

## Installation
To install WubzMod check [Releases](https://github.com/dkonis/WubzMod/releases)
To install WubzMod check [Releases](https://github.com/dkonis/WubzMod/releases).

## License
Distributed under the MIT License. See [LICENSE](https://github.com/dkonis/WubzMod/blob/main/LICENSE) for more information.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.10

# Mod Properties
mod_version = 1.19.2
mod_version = 1.0.1
maven_group = com.wubz
archives_base_name = WubzMod

Expand Down
12 changes: 10 additions & 2 deletions src/main/java/net/wubz/wubzmod/WubzMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@

import net.fabricmc.api.ModInitializer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class WubzMod implements ModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("wubzmod");
public static boolean LiveOverflowBypass = true;


public static boolean Flying = false;
public static boolean NoFallDamage = false;
public static boolean XRay = false;
public static boolean GigaChad = false;

public static MutableText ModuleStateText(boolean modEnabled, String modName) {
if(modEnabled)
return Text.translatable(modName + " \u00a7aEnabled");
else
return Text.translatable(modName + " \u00a7cDisabled");
}

public static MinecraftClient instance = MinecraftClient.getInstance();


Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/wubz/wubzmod/gui/ModHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
Expand Down
64 changes: 39 additions & 25 deletions src/main/java/net/wubz/wubzmod/gui/ModOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.SliderWidget;
import net.minecraft.client.option.GameOptions;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d;
import net.wubz.wubzmod.WubzMod;
Expand All @@ -16,48 +16,62 @@
public class ModOptions extends Screen {
private final Screen parent;
private final GameOptions settings;
private static int TPDistance = 0;

public ModOptions(Screen parent, GameOptions gameOptions) {
super(Text.translatable("Wubz's Tools"));
this.parent = parent;
this.settings = gameOptions;
}

MutableText ModText(boolean modEnabled,String modName) {
if(modEnabled)
return Text.translatable(modName + " \u00a7aEnabled");
else
return Text.translatable(modName + " \u00a7cDisabled");
}

protected void init() {
this.addDrawableChild(new ButtonWidget(10, 10, 90, 20, Text.translatable("Game Menu"), (button) -> {
assert this.client != null;
this.client.setScreen(this.parent);
}));

this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 25, 60, 20, Text.translatable("TP X"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 - 102, this.height / 6 + 25, 98, 20, Text.translatable("Teleport"), (button) -> {
assert WubzMod.instance.player != null;
String direction = WubzMod.instance.player.getHorizontalFacing().asString();
float pitch = WubzMod.instance.player.getPitch();
WubzMod.LOGGER.info(direction + WubzMod.instance.player.getPitch());
Vec3d pos = WubzMod.instance.player.getPos();
WubzMod.instance.player.setPos(pos.getX()+ 5, pos.getY(), pos.getZ());
WubzMod.instance.player.kill();
switch (direction) {
case "south" -> WubzMod.instance.player.setPos(pos.getX(), pos.getY(), pos.getZ() + TPDistance);
case "west" -> WubzMod.instance.player.setPos(pos.getX() - TPDistance, pos.getY(), pos.getZ());
case "north" -> WubzMod.instance.player.setPos(pos.getX(), pos.getY(), pos.getZ() - TPDistance);
case "east" -> WubzMod.instance.player.setPos(pos.getX() + TPDistance, pos.getY(), pos.getZ());
}
if(pitch <= -60.0)
WubzMod.instance.player.setPos(pos.getX(), pos.getY() + TPDistance, pos.getZ());
else if(pitch >= 60.0) {
WubzMod.instance.player.setPos(pos.getX(), pos.getY() - TPDistance, pos.getZ());
}
}));

this.addDrawableChild(new ButtonWidget(this.width / 2 - 30, this.height / 6 + 25, 60, 20, Text.translatable("TP Y"), (button) -> {
Vec3d pos = WubzMod.instance.player.getPos();
WubzMod.instance.player.setPos(pos.getX(), pos.getY() + 5, pos.getZ() + 5);
}));
this.addDrawableChild(new SliderWidget(this.width / 2 + 4, this.height / 6 + 25, 98, 20, Text.translatable("TP Distance: " + TPDistance), (float) (TPDistance / 20)) {
@Override
protected void updateMessage() {
this.setMessage(Text.translatable("TP Distance: " + TPDistance));
}

this.addDrawableChild(new ButtonWidget(this.width / 2 + 40, this.height / 6 + 25, 60, 20, Text.translatable("TP Z"), (button) -> {
Vec3d pos = WubzMod.instance.player.getPos();
WubzMod.instance.player.setPos(pos.getX(), pos.getY(), pos.getZ() + 5);
}));
@Override
protected void applyValue() {
TPDistance = (int) (this.value * 20);
}
});

this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 50, 200, 20, ModText(WubzMod.Flying, "Flying hack:"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 - 102, this.height / 6 + 50, 98, 20, WubzMod.ModuleStateText(WubzMod.Flying, "Flying:"), (button) -> {
WubzMod.Flying = !WubzMod.Flying;
button.setMessage(ModText(WubzMod.Flying, "Flying hack:"));
button.setMessage(WubzMod.ModuleStateText(WubzMod.Flying, "Flying:"));
}));

this.addDrawableChild(new ButtonWidget(this.width / 2 + 4, this.height / 6 + 50, 98, 20, WubzMod.ModuleStateText(WubzMod.NoFallDamage, "NoFall:"), (button) -> {
WubzMod.NoFallDamage = !WubzMod.NoFallDamage;
button.setMessage(WubzMod.ModuleStateText(WubzMod.NoFallDamage, "NoFall:"));
}));

this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 75, 200, 20, ModText(WubzMod.XRay, "XRay hack:"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 - 102, this.height / 6 + 75, 204, 20, WubzMod.ModuleStateText(WubzMod.XRay, "XRay:"), (button) -> {
assert client != null;
if(client.worldRenderer.isTerrainRenderComplete()) {
WubzMod.XRay = !WubzMod.XRay;
Expand All @@ -69,14 +83,14 @@ protected void init() {
WubzMod.instance.player.removeStatusEffect(StatusEffect.byRawId(16));
}
client.worldRenderer.reload();
button.setMessage(ModText(WubzMod.XRay, "XRay hack:"));
button.setMessage(WubzMod.ModuleStateText(WubzMod.XRay, "XRay:"));
}
}));

this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 100, 200, 20, ModText(WubzMod.GigaChad, "GigaChad hack:"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 - 102, this.height / 6 + 100, 204, 20, WubzMod.ModuleStateText(WubzMod.GigaChad, "GigaChad mode:"), (button) -> {
WubzMod.GigaChad = !WubzMod.GigaChad;
GigaChad.GigaChad();
button.setMessage(ModText(WubzMod.GigaChad, "GigaChad hack:"));
button.setMessage(WubzMod.ModuleStateText(WubzMod.GigaChad, "GigaChad mode:"));
}));

}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/net/wubz/wubzmod/mixin/GameInfoMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.wubz.wubzmod.WubzMod;
import net.wubz.wubzmod.gui.ModHud;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
import net.wubz.wubzmod.WubzMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(GameStateChangeS2CPacket.class)
public class GameStateChangeS2CPacketMixin {
Expand All @@ -15,11 +17,11 @@ public class GameStateChangeS2CPacketMixin {
* Bypassing LiveOverflow's demo by not applying
* the GameStateChange Packet
*/
@Overwrite
public void apply(ClientPlayPacketListener clientPlayPacketListener) {
@Inject(at = @At("HEAD") , method = "apply", cancellable = true)
public void apply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo ci) {
GameStateChangeS2CPacket packet = (GameStateChangeS2CPacket) (Object) this;
if(!WubzMod.LiveOverflowBypass){
clientPlayPacketListener.onGameStateChange(packet);
}
if(WubzMod.LiveOverflowBypass && (packet.getValue() == 1.0 || packet.getValue() == 0.0 || packet.getValue() == 101.0
|| packet.getValue() == 102.0 || packet.getValue() == 103.0 || packet.getValue() == 104.0))
ci.cancel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.minecraft.client.MinecraftClient;
import net.wubz.wubzmod.modules.Flying;
import net.wubz.wubzmod.modules.NoFallDamage;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -12,5 +13,6 @@ public class MinecraftClientMixin {
@Inject(at = @At("TAIL"), method = "tick")
private void tick(CallbackInfo ci) {
Flying.Flying();
NoFallDamage.NoFall();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

@Mixin(PlayerMoveC2SPacket.Full.class)
Expand Down
14 changes: 2 additions & 12 deletions src/main/java/net/wubz/wubzmod/mixin/TitleScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.world.SelectWorldScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.wubz.wubzmod.WubzMod;
import net.wubz.wubzmod.gui.ModOptions;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -18,18 +15,11 @@ public abstract class TitleScreenMixin extends Screen {

protected TitleScreenMixin(Text title) { super(title); }

MutableText ModText(boolean modEnabled,String modName) {
if(modEnabled)
return Text.translatable(modName + " \u00a7aEnabled");
else
return Text.translatable(modName + " \u00a7cDisabled");
}

@Inject(at = @At("HEAD"), method = "initWidgetsNormal(II)V")
private void onInitWigets(int y, int spacingY, CallbackInfo ci){
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, y + spacingY * 5 - 10, 200, 20, ModText(WubzMod.LiveOverflowBypass, "LiveOverflow Bypass:"), (button) -> {
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, y + spacingY * 5 - 10, 200, 20, WubzMod.ModuleStateText(WubzMod.LiveOverflowBypass, "LiveOverflow Bypass:"), (button) -> {
WubzMod.LiveOverflowBypass = !WubzMod.LiveOverflowBypass;
button.setMessage(ModText(WubzMod.LiveOverflowBypass, "LiveOverflow Bypass:"));
button.setMessage(WubzMod.ModuleStateText(WubzMod.LiveOverflowBypass, "LiveOverflow Bypass:"));
}));
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package net.wubz.wubzmod.mixin;

import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket;
import net.minecraft.network.packet.s2c.play.WorldBorderInitializeS2CPacket;
import net.wubz.wubzmod.WubzMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(WorldBorderInitializeS2CPacket.class)
public class WorldBorderInitializeS2CPacketMixin {
Expand All @@ -16,11 +17,9 @@ public class WorldBorderInitializeS2CPacketMixin {
* Bypassing LiveOverflow's border by not applying
* the WorldBorderInitialize Packet
*/
@Overwrite
public void apply(ClientPlayPacketListener clientPlayPacketListener) {
WorldBorderInitializeS2CPacket packet = (WorldBorderInitializeS2CPacket) (Object) this;
if(!WubzMod.LiveOverflowBypass){
clientPlayPacketListener.onWorldBorderInitialize(packet);
}
@Inject(at = @At("HEAD") , method = "apply", cancellable = true)
public void apply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo ci) {
if(WubzMod.LiveOverflowBypass)
ci.cancel();
}
}
15 changes: 14 additions & 1 deletion src/main/java/net/wubz/wubzmod/modules/Flying.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.wubz.wubzmod.modules;

import net.minecraft.entity.Entity;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
Expand All @@ -26,6 +27,18 @@ private static void enableFlying(){
WubzMod.instance.player.getAbilities().allowFlying = true;
}

if(WubzMod.instance.player.hasVehicle()){
Entity vehicle = WubzMod.instance.player.getVehicle();
Vec3d velocity = vehicle.getVelocity();
double motionY = 0;
if(WubzMod.instance.options.jumpKey.isPressed())
motionY = 0.3;
else if (WubzMod.instance.options.backKey.isPressed()) {
motionY = -0.3;
}
vehicle.setVelocity(new Vec3d(velocity.getX(), motionY, velocity.getZ()));
}

if(counter==0 && !WubzMod.instance.player.isOnGround()) {
ClientConnection conn = WubzMod.instance.player.networkHandler.getConnection();
Vec3d pos = WubzMod.instance.player.getPos().subtract(0.0, FALL_PACKET, 0.0);
Expand All @@ -34,7 +47,7 @@ private static void enableFlying(){
}

if(counter == 0)
counter = 20;
counter = 10;
counter --;

}
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/net/wubz/wubzmod/modules/NoFallDamage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package net.wubz.wubzmod.modules;

import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.wubz.wubzmod.WubzMod;

public class NoFallDamage {
public static void NoFall(){
if(WubzMod.instance.player!=null && WubzMod.NoFallDamage)
{
enableNoFall();
}
}
private static void enableNoFall(){
if(isFallingFastEnoughToCauseDamage()) {
assert WubzMod.instance.player != null;
WubzMod.instance.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true));
}
}

private static boolean isFallingFastEnoughToCauseDamage()
{
assert WubzMod.instance.player != null;
return WubzMod.instance.player.getVelocity().y < -0.5;
}
}

0 comments on commit ed7678c

Please sign in to comment.