[BUG] Disable vanish on forge, since it doesn't have a forge version anymore

This commit is contained in:
2024-05-09 19:08:53 +02:00
parent 7bbbd7be62
commit 16163ac944
3 changed files with 1 additions and 30 deletions

View File

@@ -3,7 +3,7 @@ archivesBaseName = "${mod_name.replace(" ", "")}-Forge-${minecraft_version}"
dependencies {
// Compat
modImplementation("maven.modrinth:vanishmod:${vanishmod}")
// NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
// Do not edit or remove
implementation project(":Common")

View File

@@ -2,7 +2,6 @@ package com.hypherionmc.craterlib;
import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
import com.hypherionmc.craterlib.common.ForgeServerEvents;
import com.hypherionmc.craterlib.compat.Vanish;
import com.hypherionmc.craterlib.core.event.CraterEventBus;
import com.hypherionmc.craterlib.core.networking.CraterPacketNetwork;
import com.hypherionmc.craterlib.core.networking.data.PacketSide;
@@ -33,9 +32,5 @@ public class CraterLib {
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());
}
}
}

View File

@@ -1,24 +0,0 @@
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.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())));
}
}
}