Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9b59737
Added displaypriority to effect cloning
Ascynx Nov 21, 2024
80385aa
Fix size and background for a few textures (#41)
meowjade Nov 28, 2024
58d37d1
Merge remote-tracking branch 'origin/mc1.20.4' into mc1.20.4
Ascynx Nov 28, 2024
318049a
set Hexfall chest count to 43
Ascynx Jan 23, 2025
a78e04c
modmenu 9.2.0 + non-transitive
Ascynx Jan 24, 2025
e1f7352
Fix drawSprite deprecation
Ascynx Jan 25, 2025
0ef0667
re-introduced cloth config
Ascynx Jan 30, 2025
cf5f192
Updated recommended versions of other mods + fixed an incorrect comment
Ascynx Jan 30, 2025
2856cfe
move the new line for the world spoofing debug data
Ascynx Feb 7, 2025
8977bb0
Added ItemDataOverlay with the NBT data mode
Ascynx Feb 7, 2025
252dbeb
Remove Percent Damage Dealt multiplicative override
Ascynx Feb 17, 2025
d6ff151
ItemDataOverlay Tooltip Mode
Ascynx Feb 17, 2025
912cb8e
Merge branch 'Njol:mc1.20.4' into mc1.20.4
Ascynx Mar 11, 2025
02f3218
Switch use of Keybinding accessor getBoundKey to KeyBindingHelper get…
Ascynx Mar 31, 2025
65ebf5f
Fixed villager head lowering not working
Ascynx Apr 12, 2025
656386c
Fix bug relating to broken jitpack cache when using Capitalized groups
Ascynx Jul 3, 2025
d7b30f3
Added indigo to known shards
Ascynx Aug 26, 2025
b79327a
Fixed a bug with slot locking
Ascynx Aug 26, 2025
c612386
switch mixin initialization to auto discovery
Ascynx Aug 26, 2025
16d480c
resource update
Ascynx Oct 24, 2025
f52288d
Yet another effects fix
Ascynx Oct 24, 2025
a333b27
Merge remote-tracking branch 'origin/mc1.20.4' into mc1.20.4
Ascynx Oct 24, 2025
b954b7e
Removed unfinished locale keys
Ascynx Oct 24, 2025
ee855a3
Change used java version for github workflow to 21
Ascynx Oct 24, 2025
884d7ef
Fixed Minor Display bug in Tex spoof command
Ascynx Jan 6, 2026
a1ef418
base for Api mod subproject
Ascynx Feb 6, 2026
b531de9
missing from previous commit
Ascynx Feb 6, 2026
61258dd
fix duplicate artifacts
Ascynx Feb 6, 2026
92a49bf
migrate to gradle 9.14 & fabric loom 1.16
Ascynx Jun 14, 2026
3b7f958
spoofed items now only render on the main player
Ascynx Sep 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 39 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- "README.md"
workflow_dispatch:
jobs:
build:
build-main:
runs-on: ubuntu-latest
env:
GIT_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.sha }}
Expand All @@ -26,16 +26,49 @@ jobs:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

steps:
- name: Request library build ahead of time
run: |
JITPACK_URL="https://jitpack.io/com/github/Ascynx/MCConfigFramework/${{ steps.get_version.outputs.VERSION }}"
curl -s -m 30 ${JITPACK_URL} || true

- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Build with Gradle
run: chmod +x ./gradlew && ./gradlew :main:build --no-daemon
- uses: actions/upload-artifact@v4
with:
name: UnofficialMonumentaMod
path: main/build/libs/*.jar

build-api:
runs-on: ubuntu-latest
env:
GIT_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.sha }}
REF_NAME: ${{ github.ref_name }}
GITHUB_ACTOR: ${{ secrets.ACTOR }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}

steps:
- name: Request library build ahead of time
run: |
JITPACK_URL="https://jitpack.io/com/github/Ascynx/MCConfigFramework/${{ steps.get_version.outputs.VERSION }}"
curl -s -m 30 ${JITPACK_URL} || true

- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
cache: gradle
- name: Build with Gradle
run: chmod +x ./gradlew && ./gradlew build --no-daemon
run: chmod +x ./gradlew && ./gradlew :api:build --no-daemon
- uses: actions/upload-artifact@v4
with:
name: Artifact
path: build/libs/*.jar
name: MonumentaAPI
path: api/build/libs/*.jar
129 changes: 129 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
plugins {
id 'fabric-loom' version '1.16-SNAPSHOT'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.+"
// id 'java'
// id 'com.github.johnrengelman.shadow' version '1.2.2'
}

configurations {
register("shadow") {
canBeResolved = false
extendsFrom(modImplementation)
}
}

version = project.mod_version
group = project.maven_group

base {
if (project.hasProperty("mod_extradata") && !project.mod_extradata.isEmpty()) {
archivesName = project.archives_base_name + "-mc" + project.minecraft_version + "-" + project.mod_extradata;
} else {
archivesName = project.archives_base_name + "-mc" + project.minecraft_version
}
}



dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modApi ('com.terraformersmc:modmenu:9.2.0') {
transitive = false
}

modApi("me.shedaniel.cloth:cloth-config-fabric:13.0.138") {
exclude(group: "net.fabricmc.fabric-api")
}

//un-comment those if you want to load from local maven (don't have both local and jitpack sources on at the same time, dunno what it'd do I never tried it)
//modApi "ch.njol.minecraft:ui-framework-mc1_19_3:${project.ui_framework_version}"
//include "ch.njol.minecraft:ui-framework-mc1_19_3:${project.ui_framework_version}"
//modApi "ch.njol.minecraft:config-framework-mc1_19:${project.config_framework_version}"
//include "ch.njol.minecraft:config-framework-mc1_19:${project.config_framework_version}"
//un-comment those if you want to load from jitpack (don't have both local and jitpack sources on at the same time, dunno what it'd do I never tried it)
modApi(include('com.github.Ascynx:MCConfigFramework:mc1.20.4-SNAPSHOT'))
modApi(include('com.github.Ascynx:MCUIFramework:mc1.20.4-SNAPSHOT'))
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

withSourcesJar()
}

repositories {
mavenLocal()
mavenCentral()
maven { url = "https://maven.terraformersmc.com" }
maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://jitpack.io/" }
}

sourceSets {
main {
java {
srcDir("src/java")
}
resources {
srcDir("src/resources")
}
}
}

processResources {
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand project.properties
duplicatesStrategy = 'include'
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
duplicatesStrategy = 'include'
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

jar {
from("LICENSE") {
rename { "${it}_${archives_base_name}"}
}
}
//shadowJar {
// dependencies {
// include(dependency('me.shedaniel.cloth:cloth-config-fabric:.*'))
// }
//}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
4 changes: 4 additions & 0 deletions api/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Mod Properties
mod_version=0.1
maven_group=ch.njol.minecraft
archives_base_name=unofficial-monumenta-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
package ch.njol.unofficialmonumentaapi.core;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

/**
* A mixin plugin to automatically discover all mixins in the current JAR.
* <p>
* This mixin plugin automatically scans your entire JAR (or class directory, in case of an in-IDE launch) for classes inside of your
* mixin package and registers those. It does this recursively for sub packages of the mixin package as well. This means you will need
* to only have mixin classes inside your mixin package, which is good style anyway.
* <p>
* provided under <a href="https://github.com/nea89o/Forge1.8.9Template/blob/master/LICENSE"> The Unlicense license</a>
* @author Linnea Gräf
*/
public class AutoDiscoveryMixinPlugin implements IMixinConfigPlugin {
private static final List<AutoDiscoveryMixinPlugin> mixinPlugins = new ArrayList<>();

public static List<AutoDiscoveryMixinPlugin> getMixinPlugins() {
return mixinPlugins;
}

private String mixinPackage;

@Override
public void onLoad(String mixinPackage) {
this.mixinPackage = mixinPackage;
mixinPlugins.add(this);
}

/**
* Resolves the base class root for a given class URL. This resolves either the JAR root, or the class file root.
* In either case the return value of this + the class name will resolve back to the original class url, or to other
* class urls for other classes.
*/
public URL getBaseUrlForClassUrl(URL classUrl) {
String string = classUrl.toString();
if (classUrl.getProtocol().equals("jar")) {
try {
return new URL(string.substring(4).split("!")[0]);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
if (string.endsWith(".class")) {
try {
return new URL(string.replace("\\", "/")
.replace(getClass().getCanonicalName()
.replace(".", "/") + ".class", ""));
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
return classUrl;
}

/**
* Get the package that contains all the mixins. This value is set by mixin itself using {@link #onLoad}.
*/
public String getMixinPackage() {
return mixinPackage;
}

/**
* Get the path inside the class root to the mixin package
*/
public String getMixinBaseDir() {
return mixinPackage.replace(".", "/");
}

/**
* A list of all discovered mixins.
*/
private List<String> mixins = null;

/**
* Try to add mixin class ot the mixins based on the filepath inside the class root.
* Removes the {@code .class} file suffix, as well as the base mixin package.
* <p><b>This method cannot be called after mixin initialization.</p>
*
* @param className the name or path of a class to be registered as a mixin.
*/
public void tryAddMixinClass(String className) {
String norm = (className.endsWith(".class") ? className.substring(0, className.length() - ".class".length()) : className)
.replace("\\", "/")
.replace("/", ".");
if (norm.startsWith(getMixinPackage() + ".") && !norm.endsWith(".") &&
!(Character.isDigit(norm.charAt(norm.length() - 1)) && norm.charAt(norm.length() - 2) == '$')) {
mixins.add(norm.substring(getMixinPackage().length() + 1));
}
}

/**
* Search through the JAR or class directory to find mixins contained in {@link #getMixinPackage()}
*/
@Override
public List<String> getMixins() {
if (mixins != null) return mixins;
System.out.println("Trying to discover mixins");
mixins = new ArrayList<>();
URL classUrl = getClass().getProtectionDomain().getCodeSource().getLocation();
System.out.println("Found classes at " + classUrl);
Path file;
try {
file = Paths.get(getBaseUrlForClassUrl(classUrl).toURI());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
System.out.println("Base directory found at " + file);
if (Files.isDirectory(file)) {
walkDir(file);
} else {
walkJar(file);
}
System.out.println("Found mixins: " + mixins);

return mixins;
}

/**
* Search through directory for mixin classes based on {@link #getMixinBaseDir}.
*
* @param classRoot The root directory in which classes are stored for the default package.
*/
private void walkDir(Path classRoot) {
System.out.println("Trying to find mixins from directory");
try (Stream<Path> classes = Files.walk(classRoot.resolve(getMixinBaseDir()))) {
classes.filter(it -> new File(it.toUri()).isFile())
.map(it -> classRoot.relativize(it).toString())
.forEach(this::tryAddMixinClass);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

/**
* Read through a JAR file, trying to find all mixins inside.
*/
private void walkJar(Path file) {
System.out.println("Trying to find mixins from jar file");
try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(file))) {
ZipEntry next;
while ((next = zis.getNextEntry()) != null) {
tryAddMixinClass(next.getName());
zis.closeEntry();
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}

@Override public void preApply(String targetClassName, org.objectweb.asm.tree.ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {

}

@Override public void postApply(String targetClassName, org.objectweb.asm.tree.ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {

}

@Override
public String getRefMapperConfig() {
return null;
}

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return true;
}

@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {

}
}
Loading
Loading