diff --git a/build.gradle b/build.gradle index c22e059..955034f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id "com.hypherionmc.modutils.orion" version "1.0.13" + id "com.hypherionmc.modutils.orion" version "1.0.14" } orionporting { diff --git a/commit.sha b/commit.sha index 6da3da2..4d1bc95 100644 --- a/commit.sha +++ b/commit.sha @@ -1 +1 @@ -f712036d2e19267bd281397fb48ba4fe94774efa \ No newline at end of file +d9fcf547281e42215550a62152f436953b550e68 \ No newline at end of file diff --git a/patches/Forge/build.gradle.patch b/patches/Forge/build.gradle.patch index 29b9351..3e2f436 100644 --- a/patches/Forge/build.gradle.patch +++ b/patches/Forge/build.gradle.patch @@ -1,5 +1,14 @@ --- a/Forge/build.gradle +++ b/Forge/build.gradle +@@ -3,7 +3,7 @@ + + dependencies { + // Compat +- // NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}") ++ modImplementation("maven.modrinth:vanishmod:${vanishmod}") + + // Do not edit or remove + implementation project(":Common") @@ -104,8 +104,8 @@ setVersionType("release") setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-forge.md") diff --git a/patches/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java.patch b/patches/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java.patch new file mode 100644 index 0000000..e07211e --- /dev/null +++ b/patches/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java.patch @@ -0,0 +1,20 @@ +--- a/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java ++++ b/Forge/src/main/java/com/hypherionmc/craterlib/CraterLib.java +@@ -3,6 +3,7 @@ + import com.hypherionmc.craterlib.api.events.client.LateInitEvent; + import com.hypherionmc.craterlib.common.ForgeServerEvents; + import com.hypherionmc.craterlib.core.event.CraterEventBus; ++import com.hypherionmc.craterlib.compat.Vanish; + import com.hypherionmc.craterlib.core.networking.CraterPacketNetwork; + import com.hypherionmc.craterlib.core.networking.data.PacketSide; + import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment; +@@ -32,5 +33,9 @@ + LateInitEvent event = new LateInitEvent(new BridgedMinecraft(), BridgedOptions.of(Minecraft.getInstance().options)); + CraterEventBus.INSTANCE.postEvent(event); + }); ++ ++ if (ModloaderEnvironment.INSTANCE.isModLoaded("vmod")) { ++ MinecraftForge.EVENT_BUS.register(new Vanish()); ++ } + } + } diff --git a/patches/Forge/src/main/java/com/hypherionmc/craterlib/compat/Vanish.java.patch b/patches/Forge/src/main/java/com/hypherionmc/craterlib/compat/Vanish.java.patch new file mode 100644 index 0000000..39cc093 --- /dev/null +++ b/patches/Forge/src/main/java/com/hypherionmc/craterlib/compat/Vanish.java.patch @@ -0,0 +1,28 @@ +--- /dev/null ++++ b/Forge/src/main/java/com/hypherionmc/craterlib/compat/Vanish.java +@@ -1,0 +1,25 @@ ++package com.hypherionmc.craterlib.compat; ++ ++import com.hypherionmc.craterlib.api.events.server.CraterPlayerEvent; ++import com.hypherionmc.craterlib.core.event.CraterEventBus; ++import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer; ++import net.minecraft.world.entity.player.Player; ++import net.minecraftforge.eventbus.api.SubscribeEvent; ++import redstonedubstep.mods.vanishmod.api.PlayerVanishEvent; ++ ++public class Vanish { ++ ++ public Vanish() { ++ ++ } ++ ++ @SubscribeEvent ++ public void vanishevent(PlayerVanishEvent event) { ++ if (event.isVanished()) { ++ CraterEventBus.INSTANCE.postEvent(new CraterPlayerEvent.PlayerLoggedOut(BridgedPlayer.of(event.getEntity()))); ++ } else { ++ CraterEventBus.INSTANCE.postEvent(new CraterPlayerEvent.PlayerLoggedIn(BridgedPlayer.of(event.getEntity()))); ++ } ++ } ++ ++} diff --git a/patches/NeoForge/build.gradle.patch b/patches/NeoForge/build.gradle.patch index c23dd92..c7770bd 100644 --- a/patches/NeoForge/build.gradle.patch +++ b/patches/NeoForge/build.gradle.patch @@ -1,5 +1,14 @@ --- a/NeoForge/build.gradle +++ b/NeoForge/build.gradle +@@ -50,7 +50,7 @@ + from project(":Common").sourceSets.main.resources + def buildProps = project.properties.clone() + +- filesMatching("META-INF/neoforge.mods.toml") { ++ filesMatching("META-INF/mods.toml") { + expand buildProps + } + } @@ -103,8 +103,8 @@ setVersionType("release") setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-forge.md") diff --git a/settings.gradle b/settings.gradle index 7ad2501..e76050d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,4 +10,4 @@ pluginManagement { } } -rootProject.name = 'CraterLib' \ No newline at end of file +rootProject.name = 'CraterLibPort' \ No newline at end of file