Skip to content

Commit

Permalink
fix: add arch as required dep, improved roman numerals system
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed May 30, 2023
1 parent 58fbcd1 commit ce122db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ if (ENV.CURSE_TOKEN) {
addGameVersion "Fabric"
addGameVersion "${minecraft_version}"
mainArtifact(remapJar.archiveFile)
relations {
requiredDependency("architectury-api")
}
changelog = file("../CHANGELOG.md")
changelogType = 'markdown'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider;

import java.util.stream.IntStream;

public class DataGeneration implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
Expand Down Expand Up @@ -53,14 +55,14 @@ public void generateTranslations(TranslationBuilder translationBuilder) {
}

private String createRomanNumeral(int number) throws IllegalAccessException {
if (number > 3999) {
if (number > 99999) {
throw new IllegalAccessException("You can not generate a number higher than 3999 in standard roman numerals");
}

String[] singles = new String[] {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};
String[] doubles = new String[] {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};
String[] triples = new String[] {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};
String[] quads = new String[] {"", "M", "MM", "MMM"};
String[] quads = IntStream.of(9).mapToObj("M"::repeat).toArray(String[]::new);

return quads[number/1000] + triples[(number % 1000) / 100] + doubles[(number % 100) / 10] + singles[number % 10];
}
Expand Down
3 changes: 3 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ if (ENV.CURSE_TOKEN) {
addGameVersion "Forge"
addGameVersion "${minecraft_version}"
mainArtifact(remapJar.archiveFile)
relations {
requiredDependency("architectury-api")
}
changelog = file("../CHANGELOG.md")
changelogType = 'markdown'
}
Expand Down

0 comments on commit ce122db

Please sign in to comment.