Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
21 changes: 11 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'fabric-loom' version '1.10.1'
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
Expand Down Expand Up @@ -40,16 +40,17 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation("meteordevelopment:meteor-client:${project.minecraft_version}-SNAPSHOT")
modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT"
modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT"

// seed .locate and ore sim
extraLibs('com.seedfinding:mc_math:ffd2edcfcc0d18147549c88cc7d8ec6cf21b5b91') { transitive = false }
extraLibs('com.seedfinding:mc_seed:1ead6fcefe7e8de4b3d60cd6c4e993f1e8f33409') { transitive = false }
extraLibs('com.seedfinding:mc_core:1.210.0') { transitive = false }
extraLibs('com.seedfinding:mc_noise:7e3ba65e181796c4a2a1c8881d840b2254b92962') { transitive = false }
extraLibs('com.seedfinding:mc_biome:41a42cb9019a552598f12089059538853e18ec78') { transitive = false }
extraLibs('com.seedfinding:mc_terrain:b4246cbd5880c4f8745ccb90e1b102bde3448126') { transitive = false }
extraLibs('com.seedfinding:mc_feature:919b7e513cc1e87e029a9cd703fc4e2dc8686229') { transitive = false }
extraLibs('com.seedfinding:mc_math:851e9d0577dfdca50154e98f1d334bd31c641326') { transitive = false }
extraLibs('com.seedfinding:mc_seed:55f6242001f7eb4226df4ed0d023f1838a54a99d') { transitive = false }
extraLibs('com.seedfinding:mc_core:b84ff1c38be399eda096dbde2819258c62f81275') { transitive = false }
extraLibs('com.seedfinding:mc_noise:dbab3996ea3abff5dd420db53c31d5498afd2fe5') { transitive = false }
extraLibs('com.seedfinding:mc_biome:17af8cb1110fdc983b7cb2b887d1fb2060e23ee3') { transitive = false }
extraLibs('com.seedfinding:mc_terrain:a03e440ec5b282e399382f2cc5ad0db91b438d2e') { transitive = false }
extraLibs('com.seedfinding:mc_feature:755d3611ac1c499c28289ccca5b738af6a5859b7') { transitive = false }
extraLibs('com.seedfinding:mc_reversal:75aa6ce47a9f53a1aa212765e9830e08f6c86299') { transitive = false }

// seedcracker api
implementation (include('com.github.19MisterX98.SeedcrackerX:seedcrackerx-api:2.10.1')) {transitive = false}
Expand Down Expand Up @@ -93,6 +94,6 @@ tasks.withType(JavaCompile).configureEach {
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 21
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
it.options.release = targetVersion
}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
org.gradle.jvmargs=-Xmx2G

# Fabric Properties
minecraft_version=1.21.4
yarn_version=1.21.4+build.8
loader_version=0.16.9
minecraft_version=1.21.5
yarn_version=1.21.5+build.1
loader_version=0.16.10

# Mod Properties
mod_version = 0.3
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/anticope/rejects/MeteorRejectsAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onInitialize() {
modules.add(new RoboWalk());
modules.add(new ShieldBypass());
modules.add(new SilentDisconnect());
modules.add(new SkeletonESP());
// modules.add(new SkeletonESP());
modules.add(new SoundLocator());
modules.add(new TreeAura());
modules.add(new VehicleOneHit());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/anticope/rejects/commands/GiveCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
ct.putInt("Time", 1);
ct.putString("id", "minecraft:falling_block");
ct.put("BlockState", new NbtCompound());
ct.getCompound("BlockState").putString("Name", Registries.ITEM.getId(inHand.getItem()).toString());
ct.getCompound("BlockState");

} else {
ct.putString("id", "minecraft:item");
Expand Down
45 changes: 9 additions & 36 deletions src/main/java/anticope/rejects/commands/ServerCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,51 +116,24 @@ private MutableText formatPort(int port, InetAddress address) {
text.append(ports.get(port));
if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
Action.OPEN_URL,
String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser")
))
);
.withClickEvent(new ClickEvent.OpenUrl(java.net.URI.create(String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port))))
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Open in browser"))));
} else if (Objects.equals(ports.get(port), "DynMap")) {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.OPEN_URL,
String.format("http://%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser")
))
);
.withClickEvent(new ClickEvent.OpenUrl(java.net.URI.create(String.format("http://%s:%d", address.getHostAddress(), port))))
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Open in browser"))));
} else {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy")
))
);
.withClickEvent(new ClickEvent.CopyToClipboard(String.format("%s:%d", address.getHostAddress(), port)))
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Copy"))));
}
} else {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy")
))
);
.withClickEvent(new ClickEvent.CopyToClipboard(String.format("%s:%d", address.getHostAddress(), port)))
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Copy"))));
}

return text;
}

}
24 changes: 12 additions & 12 deletions src/main/java/anticope/rejects/gui/hud/RadarHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ public class RadarHud extends HudElement {
.min(1)
.sliderRange(0.01, 5)
.onChanged(aDouble -> calculateSize())
.build()
.build()
);

private final Setting<Double> zoom = sgGeneral.add(new DoubleSetting.Builder()
.name("zoom")
.description("Radar zoom.")
.defaultValue(1)
.min(0.01)
.sliderRange(0.01, 3)
.build()
.name("zoom")
.description("Radar zoom.")
.defaultValue(1)
.min(0.01)
.sliderRange(0.01, 3)
.build()
);

public RadarHud() {
Expand All @@ -93,15 +93,15 @@ public void render(HudRenderer renderer) {
double height = getHeight();
Renderer2D.COLOR.begin();
Renderer2D.COLOR.quad(x, y, width, height, backgroundColor.get());
Renderer2D.COLOR.render(null);
Renderer2D.COLOR.render();
if (mc.world != null) {
for (Entity entity : mc.world.getEntities()) {
if (!entities.get().contains(entity.getType())) return;
double xPos = ((entity.getX() - mc.player.getX()) * scale.get() * zoom.get() + width/2);
double yPos = ((entity.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + height/2);
if (xPos < 0 || yPos < 0 || xPos > width - scale.get() || yPos > height - scale.get()) continue;
String icon = "*";
if (letters.get())
if (letters.get())
icon = entity.getType().getUntranslatedName().substring(0,1).toUpperCase();
Color c = esp.getColor(entity);
if (c == null) c = Color.WHITE;
Expand All @@ -121,9 +121,9 @@ public void render(HudRenderer renderer) {
renderer.text(icon, xPos + x, yPos + y, waypoint.color.get(), false);
}
}
Renderer2D.COLOR.render(null);
Renderer2D.COLOR.render();
});

}

}
152 changes: 101 additions & 51 deletions src/main/java/anticope/rejects/gui/screens/HeadScreen.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package anticope.rejects.gui.screens;

import anticope.rejects.utils.GiveUtils;
import anticope.rejects.utils.NetworkUtils;
import com.google.common.reflect.TypeToken;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.WindowScreen;
Expand All @@ -15,13 +21,12 @@
import meteordevelopment.meteorclient.utils.network.MeteorExecutor;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.NbtComponent;
import net.minecraft.component.type.ProfileComponent;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.text.Text;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -50,15 +55,19 @@ public enum Categories {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private static Categories category = Categories.Decoration;
private final Setting<Categories> categorySetting = sgGeneral.add(new EnumSetting.Builder<Categories>()
.name("Category")
.defaultValue(category)
.description("Category")
.onChanged((v) -> this.loadHeads())
.build()
.name("Category")
.defaultValue(category)
.description("Category")
.onChanged((v) -> {
category = v;
this.loadHeads();
})
.build()
);

public HeadScreen(GuiTheme theme) {
super(theme, "Heads");
set(); // Initialize UI first
loadHeads();
}

Expand All @@ -69,62 +78,103 @@ private void set() {
}

private String getCat() {
category = categorySetting.get();
return category.toString().replace("_", "-");
}

private void loadHeads() {
ChatUtils.info("Heads", "Loading heads from category: " + getCat());

MeteorExecutor.execute(() -> {
List<Map<String, String>> res = Http.get("https://minecraft-heads.com/scripts/api.php?cat="+getCat()).sendJson(gsonType);
List<ItemStack> heads = new ArrayList<>();
res.forEach(a -> {
try {
heads.add(createHeadStack(a.get("uuid"), a.get("value"), a.get("name")));
} catch (Exception e) { }
});

WTable t = theme.table();
for (ItemStack head : heads) {
t.add(theme.item(head));
t.add(theme.label(head.getName().getString()));
WButton give = t.add(theme.button("Give")).widget();
give.action = () -> {
try {
String url = "https://minecraft-heads.com/scripts/api.php?cat=" + getCat();
List<Map<String, String>> res = Http.get(url).sendJson(gsonType);

if (res == null || res.isEmpty()) {
ChatUtils.error("Heads", "Failed to load heads or no heads found in category: " + getCat());
return;
}

List<ItemStack> heads = new ArrayList<>();
for (Map<String, String> headData : res) {
try {
GiveUtils.giveItem(head);
} catch (CommandSyntaxException e) {
ChatUtils.errorPrefix("Heads", e.getMessage());
String uuid = headData.get("uuid");
String value = headData.get("value");
String name = headData.get("name");

if (uuid != null && value != null && name != null) {
ItemStack head = createHeadStack(uuid, value, name);
if (head != null) {
heads.add(head);
}
}
} catch (Exception e) {
ChatUtils.error("Heads", "Error processing head: " + e.getMessage());
}
}

if (heads.isEmpty()) {
ChatUtils.error("Heads", "No valid heads found in category: " + getCat());
return;
}

// Update UI on the main thread
mc.execute(() -> {
set();
WTable t = theme.table();
for (ItemStack head : heads) {
t.add(theme.item(head));
t.add(theme.label(head.getName().getString()));
WButton give = t.add(theme.button("Give")).widget();
give.action = () -> {
try {
GiveUtils.giveItem(head);
} catch (CommandSyntaxException e) {
ChatUtils.errorPrefix("Heads", e.getMessage());
}
};
WButton equip = t.add(theme.button("Equip")).widget();
equip.tooltip = "Equip client-side.";
equip.action = () -> {
mc.player.getInventory().setStack(39, head);
};
t.row();
}
};
WButton equip = t.add(theme.button("Equip")).widget();
equip.tooltip = "Equip client-side.";
equip.action = () -> {
mc.player.getInventory().armor.set(3, head);
};
t.row();
add(t).expandX().minWidth(400).widget();
});
} catch (Exception e) {
ChatUtils.error("Heads", "Failed to load heads: " + e.getMessage());
e.printStackTrace();
}
set();
add(t).expandX().minWidth(400).widget();
});
}

// Using a method for heads from one of my personal mods
private ItemStack createHeadStack(String uuid, String value, String name) {
ItemStack head = Items.PLAYER_HEAD.getDefaultStack();
NbtCompound tag = new NbtCompound();
NbtCompound skullOwner = new NbtCompound();
skullOwner.putUuid("Id", UUID.fromString(uuid));
NbtCompound properties = new NbtCompound();
NbtList textures = new NbtList();
NbtCompound Value = new NbtCompound();
Value.putString("Value", value);
textures.add(Value);
properties.put("textures", textures);
skullOwner.put("Properties", properties);
tag.put("SkullOwner", skullOwner);
head.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag));
head.set(DataComponentTypes.CUSTOM_NAME, Text.literal(name));
return head;
try {
ItemStack head = Items.PLAYER_HEAD.getDefaultStack();

// Format UUID properly if needed
String formattedUuid = uuid;
if (!uuid.contains("-")) {
formattedUuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5");
}

// Create game profile directly
GameProfile gameProfile = new GameProfile(UUID.fromString(formattedUuid), name);
gameProfile.getProperties().put("textures", new Property("textures", value));

// Set profile component
head.set(DataComponentTypes.PROFILE, new ProfileComponent(gameProfile));
head.set(DataComponentTypes.CUSTOM_NAME, Text.literal(name));

return head;
} catch (Exception e) {
ChatUtils.error("Heads", "Error creating head: " + e.getMessage());
return null;
}
}

@Override
public void initWidgets() {}
public void initWidgets() {
// This method should be implemented if WindowScreen requires it
}
}
Loading