Update to Meteor-Rejects to 1.21.10
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
2025-11-01 23:32:30 -03:00
parent 4563a7e7ef
commit 4a822e773c
61 changed files with 483 additions and 328 deletions

View File

@@ -44,8 +44,9 @@ public class GiveCommand extends Command {
if (inHand.getItem() instanceof BlockItem) {
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());
NbtCompound blockState = new NbtCompound();
blockState.putString("Name", Registries.ITEM.getId(inHand.getItem()).toString());
ct.put("BlockState", blockState);
} else {
ct.putString("id", "minecraft:item");
@@ -88,7 +89,7 @@ public class GiveCommand extends Command {
var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(message))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag))
.add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag))
.build();
stack.applyChanges(changes);
@@ -108,7 +109,7 @@ public class GiveCommand extends Command {
var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(message))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag))
.add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag))
.build();
stack.applyChanges(changes);
@@ -121,8 +122,10 @@ public class GiveCommand extends Command {
String playerName = ctx.getArgument("owner", String.class);
ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD);
// For now, skip the profile component as it's causing issues
// TODO: Fix ProfileComponent usage for player heads
var changes = ComponentChanges.builder()
.add(DataComponentTypes.PROFILE, new ProfileComponent(new GameProfile(getUUID(playerName), playerName)))
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(playerName + "'s Head"))
.build();
itemStack.applyChanges(changes);

View File

@@ -8,6 +8,8 @@ import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.network.ServerAddress;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import net.minecraft.text.Text;
public class ReconnectCommand extends Command {
public ReconnectCommand() {
@@ -19,7 +21,7 @@ public class ReconnectCommand extends Command {
builder.executes(context -> {
ServerInfo info = mc.isInSingleplayer() ? null : mc.getCurrentServerEntry();
if (info != null) {
mc.world.disconnect();
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.literal("Reconnecting...")));
ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc,
ServerAddress.parse(info.address), info, false, null);
}

View File

@@ -44,7 +44,7 @@ public class SaveSkinCommand extends Command {
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(argument("player", PlayerListEntryArgumentType.create()).executes(ctx -> {
UUID id = PlayerListEntryArgumentType.get(ctx).getProfile().getId();
UUID id = PlayerListEntryArgumentType.get(ctx).getProfile().id();
String path = TinyFileDialogs.tinyfd_saveFileDialog("Save image", null, filters, null);
if (path == null) IO_EXCEPTION.create();
if (path != null) {

View File

@@ -10,12 +10,13 @@ import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource;
import net.minecraft.text.ClickEvent;
import net.minecraft.text.ClickEvent.Action;
import net.minecraft.text.HoverEvent;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import java.net.URI;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.*;
@@ -116,46 +117,38 @@ public class ServerCommand extends Command {
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)
.withClickEvent(new ClickEvent.OpenUrl(
URI.create(String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port))
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
.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)
.withClickEvent(new ClickEvent.OpenUrl(
URI.create(String.format("http://%s:%d", address.getHostAddress(), port))
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
.withHoverEvent(new HoverEvent.ShowText(
Text.literal("Open in browser")
))
);
} else {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
.withClickEvent(new ClickEvent.CopyToClipboard(
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
.withHoverEvent(new HoverEvent.ShowText(
Text.literal("Copy")
))
);
}
} else {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
.withClickEvent(new ClickEvent.CopyToClipboard(
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
.withHoverEvent(new HoverEvent.ShowText(
Text.literal("Copy")
))
);