mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 12:41:43 +00:00
F
This commit is contained in:
+24
-7
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user