Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Fixed people not able to join Hypixel #59

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.vscode
# BlueJ files
*.ctxt
.bin
bin
# Mobile Tools for Java (J2ME)
.mtj.tmp/

Expand Down
17 changes: 4 additions & 13 deletions src/main/java/keystrokesmod/module/impl/other/ClientSpoofer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
import io.netty.buffer.Unpooled;
import keystrokesmod.Raven;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.mixins.impl.network.C17PacketCustomPayloadAccessor;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.ModeSetting;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;


public class ClientSpoofer extends Module {
private final ModeSetting mode = new ModeSetting("Mode", SpoofMode.getNames(), 0);
Expand All @@ -26,15 +22,16 @@ public ClientSpoofer() {
super("ClientSpoofer", category.other);
this.registerSetting(mode, cancelForgePacket);
}

public void onDisable() {
currentSpoof = SpoofMode.FORGE;
}
@Override
public void onUpdate() {
currentSpoof = SpoofMode.values()[(int) mode.getInput()];
if(currentSpoof == SpoofMode.FORGE) {
cancelForgePacket.disable();
} else {
Raven.getModuleManager().getModule("ModSpoofer").enable();
cancelForgePacket.disable();
}
}

Expand Down Expand Up @@ -62,7 +59,7 @@ public BrandInfo(String brand, String channel) {
}

enum SpoofMode {
FORGE("Forge", "FML", "MC|Brand"),
FORGE("Forge", "FML,Forge", "MC|Brand"),
VANILLA("Vanilla", "vanilla", "MC|Brand"),
LUNAR("Lunar", "lunarclient:v2.16.0-2426", "MC|Brand"),
CHEATBREAKER("Cheatbreaker", "CB", "MC|Brand"),
Expand All @@ -83,10 +80,4 @@ enum SpoofMode {
return java.util.Arrays.stream(values()).map(spoofMode -> spoofMode.name).toArray(String[]::new);
}
}

@Contract("_ -> new")
@SuppressWarnings("All")
private @NotNull PacketBuffer createPacketBuffer(final @NotNull String data) {
return new PacketBuffer(Unpooled.buffer()).writeString(data);
}
}