Skip to content

Commit

Permalink
Port to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Fireplace committed Jul 19, 2024
1 parent 806b91f commit 2279356
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package dev.the_fireplace.lib.api.command.interfaces;

import com.mojang.brigadier.context.CommandContext;
import net.minecraft.commands.CommandRuntimeException;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.Style;
import net.minecraft.server.level.ServerPlayer;

public interface FeedbackSender
{
int throwFailure(CommandContext<CommandSourceStack> command, String translationKey, Object... args) throws CommandRuntimeException;
int throwFailure(CommandContext<CommandSourceStack> command, String translationKey, Object... args) throws CommandSyntaxException;

void basic(CommandContext<CommandSourceStack> command, String translationKey, Object... args);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package dev.the_fireplace.lib.command.helpers;

import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandExceptionType;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import dev.the_fireplace.lib.api.chat.injectables.MessageQueue;
import dev.the_fireplace.lib.api.chat.injectables.TextStyles;
import dev.the_fireplace.lib.api.chat.interfaces.Translator;
import dev.the_fireplace.lib.api.command.interfaces.FeedbackSender;
import dev.the_fireplace.lib.mixin.CommandSourceStackAccessor;
import net.minecraft.commands.CommandRuntimeException;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.Style;
import net.minecraft.server.level.ServerPlayer;

Expand All @@ -24,8 +27,9 @@ public final class SendFeedback implements FeedbackSender
}

@Override
public int throwFailure(CommandContext<CommandSourceStack> command, String translationKey, Object... args) throws CommandRuntimeException {
throw new CommandRuntimeException(translator.getTextForTarget(command.getSource(), translationKey, args).setStyle(textStyles.red()));
public int throwFailure(CommandContext<CommandSourceStack> command, String translationKey, Object... args) throws CommandSyntaxException {
MutableComponent message = translator.getTextForTarget(command.getSource(), translationKey, args).setStyle(textStyles.red());
throw new SimpleCommandExceptionType(message).create();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "${readable_name}",
"pack_format": 18
"pack_format": 22
}
}
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
archivesBaseName = "${archives_base_name}-Fabric"
def mainArtifactFile = layout.buildDirectory.file("libs/${archivesBaseName}-${version}.jar").get().asFile
def changelogFile = file('../changelog.txt')
def supportedMinecraftVersions = [project.minecraft_version]
def supportedMinecraftVersions = [project.minecraft_version, '1.20.3']

sourceSets {
api {
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"depends": {
"fabricloader": ">=0.12.0",
"fabric": "*",
"minecraft": ">=1.20.2",
"minecraft": ">=1.20.3 <1.20.5",
"annotateddi": ">=4 <5"
},

Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'org.spongepowered.mixin'
archivesBaseName = "${archives_base_name}-Forge"
def mainArtifactFile = layout.buildDirectory.file("libs/${archivesBaseName}-${version}.jar").get().asFile
def changelogFile = file('../changelog.txt')
def supportedMinecraftVersions = [project.minecraft_version]
def supportedMinecraftVersions = [project.minecraft_version, '1.20.3']
jarJar.enable()

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ side = "BOTH"
[[dependencies.fireplacelib]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.2,)"
versionRange = "[1.20.3,1.20.5)"
ordering = "NONE"
side = "BOTH"

Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# Common
minecraft_version=1.20.2
minecraft_version=1.20.4
# Common Dependencies
annotateddi_version=4.0.4+1.20.4
# Fabric
fabric_loader_version=0.15.11
fabric_curseforge_url=https://www.curseforge.com/minecraft/mc-mods/fireplace-lib
# Fabric Dependencies
fabric_api_version=0.91.6+1.20.2
fabric_clothconfig_version=12.0.119
modmenu_version=8.0.1
fabric_api_version=0.97.1+1.20.4
fabric_clothconfig_version=13.0.121
modmenu_version=9.0.0
# Forge
forge_version=48.1.0
forge_version=49.1.4
forge_mixin_version=0.8.5
forge_curseforge_url=https://www.curseforge.com/minecraft/mc-mods/fireplace-lib-forge
forge_update_json_url=https://api.modrinth.com/updates/fireplace-lib/forge_updates.json
# Forge Dependencies
forge_clothconfig_version=12.0.119
forge_clothconfig_version=13.0.121
# Mod Properties
maven_group=dev.the-fireplace
archives_base_name=Fireplace-Lib
Expand Down

0 comments on commit 2279356

Please sign in to comment.