Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into master…
Browse files Browse the repository at this point in the history
…-ame

# Conflicts:
#	.github/workflows/build.yml
#	.github/workflows/publish.yml
#	build.gradle
#	gradle/wrapper/gradle-wrapper.jar
#	gradle/wrapper/gradle-wrapper.properties
#	gradlew
#	gradlew.bat
#	launch/src/main/java/meteordevelopment/meteorclient/Main.java
#	src/main/java/meteordevelopment/meteorclient/commands/commands/CommandsCommand.java
#	src/main/java/meteordevelopment/meteorclient/mixin/CapeFeatureRendererMixin.java
#	src/main/java/meteordevelopment/meteorclient/mixin/GameOptionsMixin.java
#	src/main/java/meteordevelopment/meteorclient/mixin/GameRendererMixin.java
#	src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java
#	src/main/java/meteordevelopment/meteorclient/mixin/SplashTextResourceSupplierMixin.java
#	src/main/java/meteordevelopment/meteorclient/mixin/TitleScreenMixin.java
#	src/main/java/meteordevelopment/meteorclient/settings/EntityTypeListSetting.java
#	src/main/java/meteordevelopment/meteorclient/systems/modules/misc/DiscordPresence.java
#	src/main/java/meteordevelopment/meteorclient/utils/misc/input/KeyBinds.java
#	src/main/java/meteordevelopment/meteorclient/utils/network/Capes.java
#	src/main/java/meteordevelopment/meteorclient/utils/network/OnlinePlayers.java
#	src/main/resources/fabric.mod.json
#	src/main/resources/meteor-client.mixins.json
  • Loading branch information
JFronny committed May 4, 2024
2 parents 858a4aa + ea2e026 commit 642c682
Show file tree
Hide file tree
Showing 349 changed files with 3,360 additions and 2,435 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Run Gradle
uses: gradle/gradle-build-action@v2
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: current
arguments: build -Pcommit=${{ github.sha }}
- name: Build with Gradle
run: gradle build -Pcommit=${{ github.sha }}
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-1.20.4"
automatic_release_tag: "latest-1.20.6"
prerelease: false
title: "1.20.4 Build"
title: "1.20.6 Build"
files: |
./build/libs/*.jar
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'

- name: Run Gradle
uses: gradle/gradle-build-action@v2
Expand Down
94 changes: 49 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
plugins {
id "fabric-loom" version "1.5-SNAPSHOT"
id "fabric-loom" version "1.6-SNAPSHOT"
id "maven-publish"
id "com.github.johnrengelman.shadow" version "8.1.1"
}

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
base {
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
}

repositories {
maven {
Expand Down Expand Up @@ -87,61 +89,63 @@ afterEvaluate {
}
}

shadowJar {
configurations = [project.configurations.shadow]

dependencies {
exclude {
it.moduleGroup == "org.slf4j"
tasks {
processResources {
def propertyMap = [
"version" : project.version,
"minecraft_version": project.minecraft_version,
"loader_version" : project.loader_version
]

inputs.properties(propertyMap)
filesMatching("fabric.mod.json") {
expand(propertyMap)
}
}

destinationDirectory.set(new File(project.buildDir, "devlibs"))
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesBaseName}" }
}
}

processResources {
def propertyMap = [
"version" : project.version,
"minecraft_version": project.minecraft_version,
"loader_version" : project.loader_version
]
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

inputs.properties(propertyMap)
filesMatching("fabric.mod.json") {
expand(propertyMap)
withSourcesJar()
withJavadocJar()
}
}

jar {
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
}
shadowJar {
configurations = [project.configurations.shadow]

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
from("LICENSE") {
rename { "${it}_${project.base.archivesBaseName}" }
}

withSourcesJar()
}
destinationDirectory.set(new File(project.buildDir, "devlibs"))

remapJar {
dependsOn shadowJar
inputFile.set(shadowJar.archiveFile)
}
dependencies {
exclude {
it.moduleGroup == "org.slf4j"
}
}
}

javadoc {
options.addStringOption("Xdoclint:none", "-quiet")
options.encoding = "UTF-8"
}
remapJar {
dependsOn shadowJar
inputFile.set(shadowJar.archiveFile)
}

tasks.register("javadocJar", Jar) {
from javadoc
archiveClassifier.set("javadoc")
}
javadoc {
options.addStringOption("Xdoclint:none", "-quiet")
options.encoding = "UTF-8"
}

build {
dependsOn javadocJar
build {
dependsOn javadocJar
}
}

publishing {
Expand Down
20 changes: 10 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/develop)
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.2
fapi_version=0.95.3+1.20.4
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

# Mod Properties
mod_version=0.5.6
mod_version=0.5.7
maven_group=meteordevelopment
archives_base_name=meteor-client

Expand All @@ -17,16 +17,16 @@ archives_base_name=meteor-client
baritone_version=1.20.4

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

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

# Iris (https://github.com/IrisShaders/Iris)
iris_version=1.6.14+1.20.4
iris_version=1.7.0+1.20.6

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

# Orbit (https://github.com/MeteorDevelopment/orbit)
orbit_version=0.2.4
Expand All @@ -35,7 +35,7 @@ orbit_version=0.2.4
starscript_version=0.2.2

# LibJF (https://gitlab.com/jfmods/libjf)
libjf_version=3.14.1
libjf_version=3.15.6

# Reflections (https://github.com/ronmamo/reflections)
reflections_version=0.10.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void onMouseButton(MouseButtonEvent event) {

private void toggleGui() {
if (Utils.canCloseGui()) mc.currentScreen.close();
else if (Utils.canOpenGui()) Tabs.get().get(0).openScreen(GuiThemes.get());
else if (Utils.canOpenGui()) Tabs.get().getFirst().openScreen(GuiThemes.get());
}

// Hide HUD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,31 @@

package meteordevelopment.meteorclient.addons;

public record GithubRepo(String owner, String name, String branch) {
import meteordevelopment.meteorclient.utils.network.Http;

import javax.annotation.Nullable;

public record GithubRepo(String owner, String name, String branch, @Nullable String accessToken) {
public GithubRepo(String owner, String name, @Nullable String accessToken) {
this(owner, name, "master", accessToken);
}

public GithubRepo(String owner, String name) {
this(owner, name, "master");
this(owner, name, "master", null);
}

public String getOwnerName() {
return owner + "/" + name;
}

public void authenticate(Http.Request request) {
if (this.accessToken != null && !this.accessToken.isBlank()) {
request.bearer(this.accessToken);
} else {
String personalAuthToken = System.getenv("meteor.github.authorization");
if (personalAuthToken != null && !personalAuthToken.isBlank()) {
request.bearer(personalAuthToken);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.StringNbtReader;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import static net.minecraft.nbt.StringNbtReader.EXPECTED_VALUE;

public class CompoundNbtTagArgumentType implements ArgumentType<NbtCompound> {
private static final CompoundNbtTagArgumentType INSTANCE = new CompoundNbtTagArgumentType();
private static final Collection<String> EXAMPLES = Arrays.asList("{foo:bar}", "{foo:[aa, bb],bar:15}");
private static final Collection<String> EXAMPLES = List.of("{foo:bar}", "{foo:[aa, bb],bar:15}");

public static CompoundNbtTagArgumentType create() {
return INSTANCE;
Expand Down Expand Up @@ -53,8 +53,8 @@ else if (reader.peek() == '}') {
reader.expect('}');
b.append('}');
return StringNbtReader.parse(b.toString()
.replace("$", "\u00a7")
.replace("\u00a7\u00a7", "$")
.replace("$", "§")
.replace("§§", "$")
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ private MutableText getCommandText(Command command) {
tooltip.append(Text.literal(Utils.nameToTitle(command.getName())).formatted(Formatting.BLUE, Formatting.BOLD)).append("\n");

MutableText aliases = Text.literal(command.getName());
if (command.getAliases().size() > 0) {
if (!command.getAliases().isEmpty()) {
aliases.append(", ");
for (String alias : command.getAliases()) {
if (alias.isEmpty()) continue;
aliases.append(alias);
if (!alias.equals(command.getAliases().get(command.getAliases().size() - 1))) aliases.append(", ");
if (!alias.equals(command.getAliases().getLast())) aliases.append(", ");
}
}
tooltip.append(aliases.formatted(Formatting.GRAY)).append("\n\n");
Expand All @@ -59,7 +59,7 @@ private MutableText getCommandText(Command command) {

// Text
MutableText text = Text.literal(Utils.nameToTitle(command.getName()));
if (command != Commands.COMMANDS.get(Commands.COMMANDS.size() - 1))
if (command != Commands.COMMANDS.getLast())
text.append(Text.literal(", ").formatted(Formatting.GRAY));
text.setStyle(text
.getStyle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@

package meteordevelopment.meteorclient.commands.commands;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.gui.screen.DisconnectedScreen;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import net.minecraft.text.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
import meteordevelopment.meteorclient.utils.Utils;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.command.CommandSource;
import net.minecraft.command.argument.RegistryEntryArgumentType;
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;

import java.util.function.Function;
import java.util.function.ToIntFunction;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;

public class EnchantCommand extends Command {
private final static SimpleCommandExceptionType NOT_IN_CREATIVE = new SimpleCommandExceptionType(Text.literal("You must be in creative mode to use this."));
private final static SimpleCommandExceptionType NOT_HOLDING_ITEM = new SimpleCommandExceptionType(Text.literal("You need to hold some item to enchant."));
private static final SimpleCommandExceptionType NOT_IN_CREATIVE = new SimpleCommandExceptionType(Text.literal("You must be in creative mode to use this."));
private static final SimpleCommandExceptionType NOT_HOLDING_ITEM = new SimpleCommandExceptionType(Text.literal("You need to hold some item to enchant."));

public EnchantCommand() {
super("enchant", "Enchants the item in your hand. REQUIRES Creative mode.");
}

@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("one").then(argument("enchantment", RegistryEntryArgumentType.registryEntry(REGISTRY_ACCESS, RegistryKeys.ENCHANTMENT))
builder.then(literal("one").then(argument("enchantment", RegistryEntryReferenceArgumentType.registryEntry(REGISTRY_ACCESS, RegistryKeys.ENCHANTMENT))
.then(literal("level").then(argument("level", IntegerArgumentType.integer()).executes(context -> {
one(context, enchantment -> context.getArgument("level", Integer.class));
return SINGLE_SUCCESS;
Expand Down Expand Up @@ -78,7 +78,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
return SINGLE_SUCCESS;
}));

builder.then(literal("remove").then(argument("enchantment", RegistryEntryArgumentType.registryEntry(REGISTRY_ACCESS, RegistryKeys.ENCHANTMENT)).executes(context -> {
builder.then(literal("remove").then(argument("enchantment", RegistryEntryReferenceArgumentType.registryEntry(REGISTRY_ACCESS, RegistryKeys.ENCHANTMENT)).executes(context -> {
ItemStack itemStack = tryGetItemStack();
RegistryEntry.Reference<Enchantment> enchantment = context.getArgument("enchantment", RegistryEntry.Reference.class);
Utils.removeEnchantment(itemStack, enchantment.value());
Expand All @@ -88,21 +88,21 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
})));
}

private void one(CommandContext<CommandSource> context, Function<Enchantment, Integer> level) throws CommandSyntaxException {
private void one(CommandContext<CommandSource> context, ToIntFunction<Enchantment> level) throws CommandSyntaxException {
ItemStack itemStack = tryGetItemStack();

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

syncItem();
}

private void all(boolean onlyPossible, Function<Enchantment, Integer> level) throws CommandSyntaxException {
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.apply(enchantment));
Utils.addEnchantment(itemStack, enchantment, level.applyAsInt(enchantment));
}
}

Expand Down
Loading

0 comments on commit 642c682

Please sign in to comment.