This commit is contained in:
Brian Neumann-Fopiano
2026-08-01 22:39:09 -04:00
parent 324cf9e095
commit a8217b42e9
220 changed files with 10626 additions and 1661 deletions
+32 -3
View File
@@ -207,6 +207,7 @@ tasks.named('shadowJar', ShadowJar).configure {
doFirst {
delete(fileTree(layout.buildDirectory.dir('libs')) {
include('Iris v* [NeoForge] *.jar')
include('iris-neoforge-*.jar')
})
delete(layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-neoforge.jar"))
}
@@ -219,15 +220,43 @@ tasks.named('shadowJar', ShadowJar).configure {
exclude('META-INF/*.SF')
exclude('META-INF/*.DSA')
exclude('META-INF/*.RSA')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
relocate('org.objectweb.asm', 'art.arcane.iris.shadow.asm')
relocate('io.sentry', 'art.arcane.iris.shadow.sentry')
// The only multi-release entry any bundled dependency contributes is an OSGi manifest. Keeping
// it forces `Multi-Release: true` onto the mod jar, which makes the loaders treat the whole
// archive as versioned and re-scan it per release directory for nothing.
exclude('META-INF/versions/**')
addMultiReleaseAttribute.set(false)
// Invalid package name on Java 9+ ('enum' is a keyword); a module-path scan chokes on it.
exclude('org/apache/commons/lang/enum/**')
// Compile-only annotation carriers. Shipping them duplicates packages other mods also ship.
exclude('org/jspecify/**')
exclude('com/google/errorprone/**')
exclude('com/google/j2objc/**')
exclude('org/checkerframework/**')
exclude('org/jetbrains/annotations/**')
exclude('org/intellij/lang/**')
// The Bukkit platform binding cannot load without org.bukkit on the classpath, which no mod
// loader has. Shipping it only adds dead classes that reference a missing package.
exclude('art/arcane/iris/platform/bukkit/**')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
relocate('org.objectweb.asm', 'art.arcane.iris.shadow.asm')
relocate('io.sentry', 'art.arcane.iris.shadow.sentry')
// Split-package guard. A co-installed mod that ships any of these at their original coordinates
// puts two copies of the same package on one module layer, which the loaders reject at boot
// (Terra ships paralithic; caffeine and dom4j are common in mod dependency trees). First-party
// art.arcane.volmlib is deliberately NOT relocated.
relocate('com.github.benmanes.caffeine', 'art.arcane.iris.shadow.caffeine')
relocate('com.googlecode.concurrentlinkedhashmap', 'art.arcane.iris.shadow.clhm')
relocate('com.dfsek.paralithic', 'art.arcane.iris.shadow.paralithic')
relocate('org.dom4j', 'art.arcane.iris.shadow.dom4j')
relocate('org.jaxen', 'art.arcane.iris.shadow.jaxen')
relocate('org.zeroturnaround.zip', 'art.arcane.iris.shadow.ztzip')
}
// The thin `jar` output carries valid neoforge.mods.toml metadata but bundles zero dependencies.
// Installing it is an instant NoClassDefFoundError, and it sits in build/libs right next to the real
// artifact. shadowJar is the only shippable NeoForge jar.
tasks.named('jar').configure {
enabled = false
}
tasks.named('assemble').configure {
@@ -97,13 +97,30 @@ public final class IrisNeoForgeBootstrap {
NeoForge.EVENT_BUS.addListener((RegisterCommandsEvent event) -> IrisModdedCommands.register(event.getDispatcher()));
NeoForge.EVENT_BUS.addListener((PermissionGatherEvent.Nodes event) ->
event.addNodes(NeoForgeModdedLoader.TREE_FELLER_PERMISSION));
NeoForge.EVENT_BUS.addListener((BreakBlockEvent event) -> {
if (event.getLevel() instanceof ServerLevel level
&& event.getPlayer() instanceof ServerPlayer player
&& !event.isCanceled()) {
ModdedBlockBreakHandler.prepare(level, player, event.getPos(), event.getState());
}
});
// LOWEST so every other mod has already had its say about cancelling the break before Iris records
// provenance for it.
NeoForge.EVENT_BUS.addListener(
EventPriority.LOWEST,
false,
(BreakBlockEvent event) -> {
if (event.getLevel() instanceof ServerLevel level
&& event.getPlayer() instanceof ServerPlayer player) {
ModdedBlockBreakHandler.prepare(level, player, event.getPos(), event.getState());
}
}
);
// Parity with the Fabric PlayerBlockBreakEvents.CANCELED hook: drop the prepared entry when the break
// never happens. It only observes cancellations from listeners registered before it at LOWEST; the
// 1-tick sweeper ModdedBlockBreakHandler.prepare schedules covers every other case.
NeoForge.EVENT_BUS.addListener(
EventPriority.LOWEST,
true,
(BreakBlockEvent event) -> {
if (event.isCanceled() && event.getLevel() instanceof ServerLevel level) {
ModdedBlockBreakHandler.cancel(level, event.getPos());
}
}
);
NeoForge.EVENT_BUS.addListener(
EventPriority.LOWEST,
false,
@@ -54,6 +54,7 @@ public final class IrisNeoForgeClient {
NeoForge.EVENT_BUS.addListener((ClientPlayerNetworkEvent.LoggingOut event) -> IrisClient.onDisconnect());
NeoForge.EVENT_BUS.addListener((ClientTickEvent.Post event) -> {
IrisClient.tick();
IrisClientHud.tick();
IrisClientKeybinds.pollToggle();
});
}
@@ -43,7 +43,7 @@ import java.nio.file.Path;
public final class NeoForgeModdedLoader implements ModdedLoader {
public static final PermissionNode<Boolean> TREE_FELLER_PERMISSION = new PermissionNode<>(
"iris",
"irisworldgen",
"treefeller",
PermissionTypes.BOOLEAN,
(player, playerId, contexts) ->
@@ -1,6 +1,7 @@
modLoader = "javafml"
loaderVersion = "[3,)"
license = "GPL-3.0"
issueTrackerURL = "https://github.com/VolmitSoftware/Iris/issues"
[[mixins]]
config = "irisworldgen.entity.mixins.json"
@@ -8,17 +9,23 @@ config = "irisworldgen.entity.mixins.json"
[[mixins]]
config = "irisworldgen.client.mixins.json"
[[accessTransformers]]
file = "META-INF/accesstransformer.cfg"
[[mods]]
modId = "irisworldgen"
version = "${version}"
displayName = "Iris"
description = "Iris World Generation Engine (NeoForge adapter - native chunk generator, explicit Iris world datapack workflow, engine lifecycle)"
authors = "Arcane Arts (Volmit Software)"
credits = "cyberpwn, NextdoorPsycho, Vatuu"
displayURL = "https://docs.volmit.com/iris/"
logoFile = "assets/irisworldgen/icon.png"
[[dependencies.irisworldgen]]
modId = "neoforge"
type = "required"
versionRange = "[26.2,)"
versionRange = "[26.2,26.3)"
ordering = "NONE"
side = "BOTH"