Skip to content

Commit

Permalink
1.21 update (#4640)
Browse files Browse the repository at this point in the history
  • Loading branch information
Big-Iron-Cheems authored Jun 23, 2024
1 parent 57f36ca commit 0ce909c
Show file tree
Hide file tree
Showing 124 changed files with 828 additions and 559 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "1.6-SNAPSHOT"
id "fabric-loom" version "1.7-SNAPSHOT"
id "maven-publish"
id "com.github.johnrengelman.shadow" version "8.1.1"
}
Expand Down Expand Up @@ -74,7 +74,7 @@ dependencies {
library "org.reflections:reflections:${project.reflections_version}"
library("io.netty:netty-handler-proxy:${project.netty_version}") { transitive = false }
library("io.netty:netty-codec-socks:${project.netty_version}") { transitive = false }
library "de.florianmichael:WaybackAuthLib:1.0.0"
library "de.florianmichael:WaybackAuthLib:${project.waybackauthlib_version}"

// Launch sub project
shadow project(":launch")
Expand Down
24 changes: 14 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/develop)
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.10
fapi_version=0.97.8+1.20.6
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11
fapi_version=0.100.3+1.21

# Mod Properties
mod_version=0.5.8
Expand All @@ -14,19 +14,20 @@ archives_base_name=meteor-client
# Dependency Versions

# Baritone (https://github.com/MeteorDevelopment/baritone)
baritone_version=1.20.4
baritone_version=1.20.6

# Sodium (https://github.com/CaffeineMC/sodium-fabric)
sodium_version=mc1.20.6-0.5.8
sodium_version=mc1.21-0.5.9

# Lithium (https://github.com/CaffeineMC/lithium-fabric)
lithium_version=mc1.20.6-0.12.3
lithium_version=mc1.21-0.12.7

# Iris (https://github.com/IrisShaders/Iris)
iris_version=1.7.0+1.20.6
iris_version=1.7.1+1.20.6
# 1.7.1+1.21 seems to cause loom remapping issues atm

# Indium (https://github.com/comp500/Indium)
indium_version=1.0.30+mc1.20.4
indium_version=1.0.33+mc1.21

# Orbit (https://github.com/MeteorDevelopment/orbit)
orbit_version=0.2.4
Expand All @@ -44,4 +45,7 @@ reflections_version=0.10.2
netty_version=4.1.90.Final

# ViaFabricPlus (https://github.com/ViaVersion/ViaFabricPlus)
viafabricplus_version=3.2.1
viafabricplus_version=3.4.1

# WaybackAuthLib (https://github.com/FlorianMichael/WaybackAuthLib)
waybackauthlib_version=1.0.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -183,4 +184,8 @@ private void onOpenScreen(OpenScreenEvent event) {

wasWidgetScreen = event.screen instanceof WidgetScreen;
}

public static Identifier identifier(String path) {
return Identifier.of(MeteorClient.MOD_ID, path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import net.minecraft.command.argument.RegistryEntryReferenceArgumentType;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -89,19 +88,19 @@ private void one(CommandContext<CommandSource> context, ToIntFunction<Enchantmen
ItemStack itemStack = tryGetItemStack();

RegistryEntry.Reference<Enchantment> enchantment = context.getArgument("enchantment", RegistryEntry.Reference.class);
Utils.addEnchantment(itemStack, enchantment.value(), level.applyAsInt(enchantment.value()));
Utils.addEnchantment(itemStack, enchantment, level.applyAsInt(enchantment.value()));

syncItem();
}

private void all(boolean onlyPossible, ToIntFunction<Enchantment> level) throws CommandSyntaxException {
ItemStack itemStack = tryGetItemStack();

for (Enchantment enchantment : Registries.ENCHANTMENT) {
if (!onlyPossible || enchantment.isAcceptableItem(itemStack)) {
Utils.addEnchantment(itemStack, enchantment, level.applyAsInt(enchantment));
}
}
REGISTRY_ACCESS.getOptionalWrapper(RegistryKeys.ENCHANTMENT).ifPresent(registry -> {
registry.streamEntries().forEach(enchantment -> {
Utils.addEnchantment(itemStack, enchantment, level.applyAsInt(enchantment.value()));
});
});

syncItem();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
dataResult.getOrThrow(MALFORMED_ITEM_EXCEPTION::create);

ComponentChanges.Builder changesBuilder = ComponentChanges.builder();
Set<DataComponentType<?>> types = stackComponents.getTypes();
Set<ComponentType<?>> types = stackComponents.getTypes();

//set changes
for (Component<?> entry : components) {
Expand All @@ -94,7 +94,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
}

//remove the rest
for (DataComponentType<?> type : types) {
for (ComponentType<?> type : types) {
changesBuilder.remove(type);
}

Expand All @@ -111,9 +111,9 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {

if (validBasic(stack)) {
@SuppressWarnings("unchecked")
RegistryKey<DataComponentType<?>> componentTypeKey = (RegistryKey<DataComponentType<?>>) ctx.getArgument("component", RegistryKey.class);
RegistryKey<ComponentType<?>> componentTypeKey = (RegistryKey<ComponentType<?>>) ctx.getArgument("component", RegistryKey.class);

DataComponentType<?> componentType = Registries.DATA_COMPONENT_TYPE.get(componentTypeKey);
ComponentType<?> componentType = Registries.DATA_COMPONENT_TYPE.get(componentTypeKey);

ComponentMapImpl components = (ComponentMapImpl) stack.getComponents();
components.applyChanges(ComponentChanges.builder().remove(componentType).build());
Expand All @@ -132,7 +132,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
if (entry.getKey().isPresent()) return entry.getKey().get().getValue();
return null;
}, entry -> {
DataComponentType<?> dataComponentType = entry.value();
ComponentType<?> dataComponentType = entry.value();
if (dataComponentType.getCodec() != null) {
if (entry.getKey().isPresent()) {
suggestionsBuilder.suggest(entry.getKey().get().getValue().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import meteordevelopment.meteorclient.systems.modules.misc.Notebot;
import meteordevelopment.meteorclient.utils.notebot.song.Note;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.enums.Instrument;
import net.minecraft.block.enums.NoteBlockInstrument;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.sound.SoundEvent;
Expand Down Expand Up @@ -168,7 +168,7 @@ private void saveRecording(Path path) {
List<Note> notes = entry.getValue();

for (var note : notes) {
Instrument instrument = note.getInstrument();
NoteBlockInstrument instrument = note.getInstrument();
int noteLevel = note.getNoteLevel();

file.write(String.format("%d:%d:%d\n", tick, noteLevel, instrument.ordinal()));
Expand Down Expand Up @@ -202,7 +202,7 @@ private Note getNote(PlaySoundS2CPacket soundPacket) {
return null;
}

Instrument instrument = getInstrumentFromSound(soundPacket.getSound().value());
NoteBlockInstrument instrument = getInstrumentFromSound(soundPacket.getSound().value());
if (instrument == null) {
error("Can't find the instrument from sound! Sound: " + soundPacket.getSound().value());
return null;
Expand All @@ -211,40 +211,40 @@ private Note getNote(PlaySoundS2CPacket soundPacket) {
return new Note(instrument, noteLevel);
}

private Instrument getInstrumentFromSound(SoundEvent sound) {
private NoteBlockInstrument getInstrumentFromSound(SoundEvent sound) {
String path = sound.getId().getPath();
if (path.contains("harp"))
return Instrument.HARP;
return NoteBlockInstrument.HARP;
else if (path.contains("basedrum"))
return Instrument.BASEDRUM;
return NoteBlockInstrument.BASEDRUM;
else if (path.contains("snare"))
return Instrument.SNARE;
return NoteBlockInstrument.SNARE;
else if (path.contains("hat"))
return Instrument.HAT;
return NoteBlockInstrument.HAT;
else if (path.contains("bass"))
return Instrument.BASS;
return NoteBlockInstrument.BASS;
else if (path.contains("flute"))
return Instrument.FLUTE;
return NoteBlockInstrument.FLUTE;
else if (path.contains("bell"))
return Instrument.BELL;
return NoteBlockInstrument.BELL;
else if (path.contains("guitar"))
return Instrument.GUITAR;
return NoteBlockInstrument.GUITAR;
else if (path.contains("chime"))
return Instrument.CHIME;
return NoteBlockInstrument.CHIME;
else if (path.contains("xylophone"))
return Instrument.XYLOPHONE;
return NoteBlockInstrument.XYLOPHONE;
else if (path.contains("iron_xylophone"))
return Instrument.IRON_XYLOPHONE;
return NoteBlockInstrument.IRON_XYLOPHONE;
else if (path.contains("cow_bell"))
return Instrument.COW_BELL;
return NoteBlockInstrument.COW_BELL;
else if (path.contains("didgeridoo"))
return Instrument.DIDGERIDOO;
return NoteBlockInstrument.DIDGERIDOO;
else if (path.contains("bit"))
return Instrument.BIT;
return NoteBlockInstrument.BIT;
else if (path.contains("banjo"))
return Instrument.BANJO;
return NoteBlockInstrument.BANJO;
else if (path.contains("pling"))
return Instrument.PLING;
return NoteBlockInstrument.PLING;
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package meteordevelopment.meteorclient.events.render;

import net.minecraft.client.item.TooltipData;
import net.minecraft.item.tooltip.TooltipData;
import net.minecraft.item.ItemStack;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package meteordevelopment.meteorclient.gui.renderer;

import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.renderer.operations.TextOperation;
import meteordevelopment.meteorclient.gui.renderer.packer.GuiTexture;
Expand All @@ -14,7 +15,6 @@
import meteordevelopment.meteorclient.renderer.Renderer2D;
import meteordevelopment.meteorclient.renderer.Texture;
import meteordevelopment.meteorclient.utils.PostInit;
import meteordevelopment.meteorclient.utils.misc.MeteorIdentifier;
import meteordevelopment.meteorclient.utils.misc.Pool;
import meteordevelopment.meteorclient.utils.render.ByteTexture;
import meteordevelopment.meteorclient.utils.render.RenderUtils;
Expand Down Expand Up @@ -68,12 +68,12 @@ public static GuiTexture addTexture(Identifier id) {

@PostInit
public static void init() {
CIRCLE = addTexture(new MeteorIdentifier("textures/icons/gui/circle.png"));
TRIANGLE = addTexture(new MeteorIdentifier("textures/icons/gui/triangle.png"));
EDIT = addTexture(new MeteorIdentifier("textures/icons/gui/edit.png"));
RESET = addTexture(new MeteorIdentifier("textures/icons/gui/reset.png"));
FAVORITE_NO = addTexture(new MeteorIdentifier("textures/icons/gui/favorite_no.png"));
FAVORITE_YES = addTexture(new MeteorIdentifier("textures/icons/gui/favorite_yes.png"));
CIRCLE = addTexture(MeteorClient.identifier("textures/icons/gui/circle.png"));
TRIANGLE = addTexture(MeteorClient.identifier("textures/icons/gui/triangle.png"));
EDIT = addTexture(MeteorClient.identifier("textures/icons/gui/edit.png"));
RESET = addTexture(MeteorClient.identifier("textures/icons/gui/reset.png"));
FAVORITE_NO = addTexture(MeteorClient.identifier("textures/icons/gui/favorite_no.png"));
FAVORITE_YES = addTexture(MeteorClient.identifier("textures/icons/gui/favorite_yes.png"));

TEXTURE = TEXTURE_PACKER.pack();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.util.List;
import java.util.function.Predicate;

public class BlockListSettingScreen extends LeftRightListSettingScreen<Block> {
private static final Identifier ID = new Identifier("minecraft", "");
public class BlockListSettingScreen extends RegistryListSettingScreen<Block> {
private static final Identifier ID = Identifier.of("minecraft", "");

public BlockListSettingScreen(GuiTheme theme, Setting<List<Block>> setting) {
super(theme, "Select Blocks", setting, setting.get(), Registries.BLOCK);
Expand Down Expand Up @@ -54,7 +54,7 @@ protected Block getAdditionalValue(Block value) {
String path = Registries.BLOCK.getId(value).getPath();
if (!path.endsWith("_banner")) return null;

((IdentifierAccessor) ID).setPath(path.substring(0, path.length() - 6) + "wall_banner");
((IdentifierAccessor) (Object) ID).setPath(path.substring(0, path.length() - 6) + "wall_banner");
return Registries.BLOCK.get(ID);
}
}
Loading

0 comments on commit 0ce909c

Please sign in to comment.