Skip to content

Commit 3413ac4

Browse files
Updated to 1.21.5 and commented SkeletonESP.java
1 parent 4563a7e commit 3413ac4

35 files changed

+502
-355
lines changed

build.gradle

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.9-SNAPSHOT'
2+
id 'fabric-loom' version '1.10.1'
33
}
44

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

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

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

5455
// seedcracker api
5556
implementation (include('com.github.19MisterX98.SeedcrackerX:seedcrackerx-api:2.10.1')) {transitive = false}
@@ -93,6 +94,6 @@ tasks.withType(JavaCompile).configureEach {
9394
// We'll use that if it's available, but otherwise we'll use the older option.
9495
def targetVersion = 21
9596
if (JavaVersion.current().isJava9Compatible()) {
96-
it.options.release = targetVersion
97+
it.options.release = targetVersion
9798
}
9899
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
org.gradle.jvmargs=-Xmx2G
33

44
# Fabric Properties
5-
minecraft_version=1.21.4
6-
yarn_version=1.21.4+build.8
7-
loader_version=0.16.9
5+
minecraft_version=1.21.5
6+
yarn_version=1.21.5+build.1
7+
loader_version=0.16.10
88

99
# Mod Properties
1010
mod_version = 0.3

src/main/java/anticope/rejects/MeteorRejectsAddon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void onInitialize() {
7979
modules.add(new RoboWalk());
8080
modules.add(new ShieldBypass());
8181
modules.add(new SilentDisconnect());
82-
modules.add(new SkeletonESP());
82+
// modules.add(new SkeletonESP());
8383
modules.add(new SoundLocator());
8484
modules.add(new TreeAura());
8585
modules.add(new VehicleOneHit());

src/main/java/anticope/rejects/commands/GiveCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
4545
ct.putInt("Time", 1);
4646
ct.putString("id", "minecraft:falling_block");
4747
ct.put("BlockState", new NbtCompound());
48-
ct.getCompound("BlockState").putString("Name", Registries.ITEM.getId(inHand.getItem()).toString());
48+
ct.getCompound("BlockState");
4949

5050
} else {
5151
ct.putString("id", "minecraft:item");

src/main/java/anticope/rejects/commands/ServerCommand.java

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -116,51 +116,24 @@ private MutableText formatPort(int port, InetAddress address) {
116116
text.append(ports.get(port));
117117
if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) {
118118
text.setStyle(text.getStyle()
119-
.withClickEvent(new ClickEvent(
120-
Action.OPEN_URL,
121-
String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port)
122-
))
123-
.withHoverEvent(new HoverEvent(
124-
HoverEvent.Action.SHOW_TEXT,
125-
Text.literal("Open in browser")
126-
))
127-
);
119+
.withClickEvent(new ClickEvent.OpenUrl(java.net.URI.create(String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port))))
120+
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Open in browser"))));
128121
} else if (Objects.equals(ports.get(port), "DynMap")) {
129122
text.setStyle(text.getStyle()
130-
.withClickEvent(new ClickEvent(
131-
ClickEvent.Action.OPEN_URL,
132-
String.format("http://%s:%d", address.getHostAddress(), port)
133-
))
134-
.withHoverEvent(new HoverEvent(
135-
HoverEvent.Action.SHOW_TEXT,
136-
Text.literal("Open in browser")
137-
))
138-
);
123+
.withClickEvent(new ClickEvent.OpenUrl(java.net.URI.create(String.format("http://%s:%d", address.getHostAddress(), port))))
124+
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Open in browser"))));
139125
} else {
140126
text.setStyle(text.getStyle()
141-
.withClickEvent(new ClickEvent(
142-
ClickEvent.Action.COPY_TO_CLIPBOARD,
143-
String.format("%s:%d", address.getHostAddress(), port)
144-
))
145-
.withHoverEvent(new HoverEvent(
146-
HoverEvent.Action.SHOW_TEXT,
147-
Text.literal("Copy")
148-
))
149-
);
127+
.withClickEvent(new ClickEvent.CopyToClipboard(String.format("%s:%d", address.getHostAddress(), port)))
128+
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Copy"))));
150129
}
151130
} else {
152131
text.setStyle(text.getStyle()
153-
.withClickEvent(new ClickEvent(
154-
ClickEvent.Action.COPY_TO_CLIPBOARD,
155-
String.format("%s:%d", address.getHostAddress(), port)
156-
))
157-
.withHoverEvent(new HoverEvent(
158-
HoverEvent.Action.SHOW_TEXT,
159-
Text.literal("Copy")
160-
))
161-
);
132+
.withClickEvent(new ClickEvent.CopyToClipboard(String.format("%s:%d", address.getHostAddress(), port)))
133+
.withHoverEvent(new HoverEvent.ShowText(Text.literal("Copy"))));
162134
}
163135

164136
return text;
165137
}
138+
166139
}

src/main/java/anticope/rejects/gui/hud/RadarHud.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ public class RadarHud extends HudElement {
6262
.min(1)
6363
.sliderRange(0.01, 5)
6464
.onChanged(aDouble -> calculateSize())
65-
.build()
65+
.build()
6666
);
6767

6868
private final Setting<Double> zoom = sgGeneral.add(new DoubleSetting.Builder()
69-
.name("zoom")
70-
.description("Radar zoom.")
71-
.defaultValue(1)
72-
.min(0.01)
73-
.sliderRange(0.01, 3)
74-
.build()
69+
.name("zoom")
70+
.description("Radar zoom.")
71+
.defaultValue(1)
72+
.min(0.01)
73+
.sliderRange(0.01, 3)
74+
.build()
7575
);
7676

7777
public RadarHud() {
@@ -93,15 +93,15 @@ public void render(HudRenderer renderer) {
9393
double height = getHeight();
9494
Renderer2D.COLOR.begin();
9595
Renderer2D.COLOR.quad(x, y, width, height, backgroundColor.get());
96-
Renderer2D.COLOR.render(null);
96+
Renderer2D.COLOR.render();
9797
if (mc.world != null) {
9898
for (Entity entity : mc.world.getEntities()) {
9999
if (!entities.get().contains(entity.getType())) return;
100100
double xPos = ((entity.getX() - mc.player.getX()) * scale.get() * zoom.get() + width/2);
101101
double yPos = ((entity.getZ() - mc.player.getZ()) * scale.get() * zoom.get() + height/2);
102102
if (xPos < 0 || yPos < 0 || xPos > width - scale.get() || yPos > height - scale.get()) continue;
103103
String icon = "*";
104-
if (letters.get())
104+
if (letters.get())
105105
icon = entity.getType().getUntranslatedName().substring(0,1).toUpperCase();
106106
Color c = esp.getColor(entity);
107107
if (c == null) c = Color.WHITE;
@@ -121,9 +121,9 @@ public void render(HudRenderer renderer) {
121121
renderer.text(icon, xPos + x, yPos + y, waypoint.color.get(), false);
122122
}
123123
}
124-
Renderer2D.COLOR.render(null);
124+
Renderer2D.COLOR.render();
125125
});
126-
126+
127127
}
128-
128+
129129
}
Lines changed: 101 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
package anticope.rejects.gui.screens;
22

33
import anticope.rejects.utils.GiveUtils;
4+
import anticope.rejects.utils.NetworkUtils;
45
import com.google.common.reflect.TypeToken;
6+
import com.google.gson.JsonArray;
7+
import com.google.gson.JsonElement;
8+
import com.google.gson.JsonObject;
9+
import com.mojang.authlib.GameProfile;
10+
import com.mojang.authlib.properties.Property;
511
import com.mojang.brigadier.exceptions.CommandSyntaxException;
612
import meteordevelopment.meteorclient.gui.GuiTheme;
713
import meteordevelopment.meteorclient.gui.WindowScreen;
@@ -15,13 +21,12 @@
1521
import meteordevelopment.meteorclient.utils.network.MeteorExecutor;
1622
import meteordevelopment.meteorclient.utils.player.ChatUtils;
1723
import net.minecraft.component.DataComponentTypes;
18-
import net.minecraft.component.type.NbtComponent;
24+
import net.minecraft.component.type.ProfileComponent;
1925
import net.minecraft.item.ItemStack;
2026
import net.minecraft.item.Items;
2127
import net.minecraft.nbt.NbtCompound;
2228
import net.minecraft.nbt.NbtList;
2329
import net.minecraft.text.Text;
24-
2530
import java.lang.reflect.Type;
2631
import java.util.ArrayList;
2732
import java.util.List;
@@ -50,15 +55,19 @@ public enum Categories {
5055
private final SettingGroup sgGeneral = settings.getDefaultGroup();
5156
private static Categories category = Categories.Decoration;
5257
private final Setting<Categories> categorySetting = sgGeneral.add(new EnumSetting.Builder<Categories>()
53-
.name("Category")
54-
.defaultValue(category)
55-
.description("Category")
56-
.onChanged((v) -> this.loadHeads())
57-
.build()
58+
.name("Category")
59+
.defaultValue(category)
60+
.description("Category")
61+
.onChanged((v) -> {
62+
category = v;
63+
this.loadHeads();
64+
})
65+
.build()
5866
);
5967

6068
public HeadScreen(GuiTheme theme) {
6169
super(theme, "Heads");
70+
set(); // Initialize UI first
6271
loadHeads();
6372
}
6473

@@ -69,62 +78,103 @@ private void set() {
6978
}
7079

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

7684
private void loadHeads() {
85+
ChatUtils.info("Heads", "Loading heads from category: " + getCat());
86+
7787
MeteorExecutor.execute(() -> {
78-
List<Map<String, String>> res = Http.get("https://minecraft-heads.com/scripts/api.php?cat="+getCat()).sendJson(gsonType);
79-
List<ItemStack> heads = new ArrayList<>();
80-
res.forEach(a -> {
81-
try {
82-
heads.add(createHeadStack(a.get("uuid"), a.get("value"), a.get("name")));
83-
} catch (Exception e) { }
84-
});
85-
86-
WTable t = theme.table();
87-
for (ItemStack head : heads) {
88-
t.add(theme.item(head));
89-
t.add(theme.label(head.getName().getString()));
90-
WButton give = t.add(theme.button("Give")).widget();
91-
give.action = () -> {
88+
try {
89+
String url = "https://minecraft-heads.com/scripts/api.php?cat=" + getCat();
90+
List<Map<String, String>> res = Http.get(url).sendJson(gsonType);
91+
92+
if (res == null || res.isEmpty()) {
93+
ChatUtils.error("Heads", "Failed to load heads or no heads found in category: " + getCat());
94+
return;
95+
}
96+
97+
List<ItemStack> heads = new ArrayList<>();
98+
for (Map<String, String> headData : res) {
9299
try {
93-
GiveUtils.giveItem(head);
94-
} catch (CommandSyntaxException e) {
95-
ChatUtils.errorPrefix("Heads", e.getMessage());
100+
String uuid = headData.get("uuid");
101+
String value = headData.get("value");
102+
String name = headData.get("name");
103+
104+
if (uuid != null && value != null && name != null) {
105+
ItemStack head = createHeadStack(uuid, value, name);
106+
if (head != null) {
107+
heads.add(head);
108+
}
109+
}
110+
} catch (Exception e) {
111+
ChatUtils.error("Heads", "Error processing head: " + e.getMessage());
112+
}
113+
}
114+
115+
if (heads.isEmpty()) {
116+
ChatUtils.error("Heads", "No valid heads found in category: " + getCat());
117+
return;
118+
}
119+
120+
// Update UI on the main thread
121+
mc.execute(() -> {
122+
set();
123+
WTable t = theme.table();
124+
for (ItemStack head : heads) {
125+
t.add(theme.item(head));
126+
t.add(theme.label(head.getName().getString()));
127+
WButton give = t.add(theme.button("Give")).widget();
128+
give.action = () -> {
129+
try {
130+
GiveUtils.giveItem(head);
131+
} catch (CommandSyntaxException e) {
132+
ChatUtils.errorPrefix("Heads", e.getMessage());
133+
}
134+
};
135+
WButton equip = t.add(theme.button("Equip")).widget();
136+
equip.tooltip = "Equip client-side.";
137+
equip.action = () -> {
138+
mc.player.getInventory().setStack(39, head);
139+
};
140+
t.row();
96141
}
97-
};
98-
WButton equip = t.add(theme.button("Equip")).widget();
99-
equip.tooltip = "Equip client-side.";
100-
equip.action = () -> {
101-
mc.player.getInventory().armor.set(3, head);
102-
};
103-
t.row();
142+
add(t).expandX().minWidth(400).widget();
143+
});
144+
} catch (Exception e) {
145+
ChatUtils.error("Heads", "Failed to load heads: " + e.getMessage());
146+
e.printStackTrace();
104147
}
105-
set();
106-
add(t).expandX().minWidth(400).widget();
107148
});
108149
}
109-
150+
// Using a method for heads from one of my personal mods
110151
private ItemStack createHeadStack(String uuid, String value, String name) {
111-
ItemStack head = Items.PLAYER_HEAD.getDefaultStack();
112-
NbtCompound tag = new NbtCompound();
113-
NbtCompound skullOwner = new NbtCompound();
114-
skullOwner.putUuid("Id", UUID.fromString(uuid));
115-
NbtCompound properties = new NbtCompound();
116-
NbtList textures = new NbtList();
117-
NbtCompound Value = new NbtCompound();
118-
Value.putString("Value", value);
119-
textures.add(Value);
120-
properties.put("textures", textures);
121-
skullOwner.put("Properties", properties);
122-
tag.put("SkullOwner", skullOwner);
123-
head.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag));
124-
head.set(DataComponentTypes.CUSTOM_NAME, Text.literal(name));
125-
return head;
152+
try {
153+
ItemStack head = Items.PLAYER_HEAD.getDefaultStack();
154+
155+
// Format UUID properly if needed
156+
String formattedUuid = uuid;
157+
if (!uuid.contains("-")) {
158+
formattedUuid = uuid.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5");
159+
}
160+
161+
// Create game profile directly
162+
GameProfile gameProfile = new GameProfile(UUID.fromString(formattedUuid), name);
163+
gameProfile.getProperties().put("textures", new Property("textures", value));
164+
165+
// Set profile component
166+
head.set(DataComponentTypes.PROFILE, new ProfileComponent(gameProfile));
167+
head.set(DataComponentTypes.CUSTOM_NAME, Text.literal(name));
168+
169+
return head;
170+
} catch (Exception e) {
171+
ChatUtils.error("Heads", "Error creating head: " + e.getMessage());
172+
return null;
173+
}
126174
}
127175

128176
@Override
129-
public void initWidgets() {}
177+
public void initWidgets() {
178+
// This method should be implemented if WindowScreen requires it
179+
}
130180
}

0 commit comments

Comments
 (0)