diff --git a/build.gradle b/build.gradle index 0d0f23d..d5de2b7 100644 --- a/build.gradle +++ b/build.gradle @@ -18,15 +18,24 @@ repositories { // for more information about repositories. maven { url 'https://maven.nucleoid.xyz' } maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } + maven { url 'https://api.modrinth.com/maven' } + mavenLocal() - maven { + /*maven { name = "TerraformersMC" url = "https://maven.terraformersmc.com/" - } + }*/ + maven { name = "Ladysnake Libs" url = "https://ladysnake.jfrog.io/artifactory/mods" } + + flatDir { + dirs './modsWithCompat' + } + maven { url "https://maven.jamieswhiteshirt.com/libs-release/" } + } dependencies { @@ -39,14 +48,20 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modImplementation include("eu.pb4:sgui:1.0.0-rc2-1.17") + modImplementation include("eu.pb4:sgui:1.0.0-rc3-1.17.1") modImplementation include("eu.pb4:hologram-api:0.1.1+1.17") - modImplementation include("eu.pb4:placeholder-api:1.0.0-1.17") + modImplementation include("eu.pb4:placeholder-api:1.0.1+1.17") modImplementation include("eu.pb4:polymer:0.1.0-pre5-1.17") modImplementation include("fr.catcore:server-translations-api:1.4.5+1.17") modImplementation include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT") - modCompileOnly "dev.emi:trinkets:3.0.0" + //modCompileOnly "dev.emi:trinkets:3.0.0" + modCompileOnly "maven.modrinth:trinkets:3.0.0" + + modCompileOnly "draylar:get-off-my-lawn:1.17-1.4.0-beta" + modCompileOnly "com.jamieswhiteshirt:rtree-3i-lite-fabric:0.3.0" + modCompileOnly "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:3.0.0-nightly.21w19a" + // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. diff --git a/gradle.properties b/gradle.properties index 3b61b26..00aefeb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.17 - yarn_mappings=1.17+build.13 + minecraft_version=1.17.1 + yarn_mappings=1.17.1+build.1 loader_version=0.11.3 # Mod Properties - mod_version = 1.0.5 + mod_version = 1.0.6+1.17.1 maven_group = eu.pb4 archives_base_name = graves diff --git a/modsWithCompat/get-off-my-lawn-1.17-1.4.0-beta.jar b/modsWithCompat/get-off-my-lawn-1.17-1.4.0-beta.jar new file mode 100644 index 0000000..2794f9a Binary files /dev/null and b/modsWithCompat/get-off-my-lawn-1.17-1.4.0-beta.jar differ diff --git a/src/main/java/eu/pb4/graves/GravesMod.java b/src/main/java/eu/pb4/graves/GravesMod.java index 4bb2369..bfbcf2b 100644 --- a/src/main/java/eu/pb4/graves/GravesMod.java +++ b/src/main/java/eu/pb4/graves/GravesMod.java @@ -1,5 +1,6 @@ package eu.pb4.graves; +import eu.pb4.graves.compat.GomlCompat; import eu.pb4.graves.compat.TrinketsCompat; import eu.pb4.graves.grave.GraveBlock; import eu.pb4.graves.grave.GraveBlockEntity; @@ -32,6 +33,9 @@ public void onInitialize() { if (loader.isModLoaded("trinkets")) { TrinketsCompat.register(); } + if (loader.isModLoaded("goml")) { + GomlCompat.register(); + } ServerLifecycleEvents.SERVER_STARTING.register((server) -> ConfigManager.loadConfig()); ServerLifecycleEvents.SERVER_STARTED.register((server -> diff --git a/src/main/java/eu/pb4/graves/compat/GomlCompat.java b/src/main/java/eu/pb4/graves/compat/GomlCompat.java new file mode 100644 index 0000000..26a3805 --- /dev/null +++ b/src/main/java/eu/pb4/graves/compat/GomlCompat.java @@ -0,0 +1,18 @@ +package eu.pb4.graves.compat; + + +import draylar.goml.api.event.ClaimEvents; +import eu.pb4.graves.grave.GraveBlockEntity; +import net.minecraft.util.ActionResult; + +public class GomlCompat { + public static void register() { + ClaimEvents.PERMISSION_DENIED.register((player, world, hand, pos, reason) -> { + if (world.getBlockEntity(pos) instanceof GraveBlockEntity grave && grave.canPlayerUse(player)) { + return ActionResult.FAIL; + } + + return ActionResult.PASS; + }); + } +}