[FEAT] APIs for Player Revive mod and Whitelist changes
This commit is contained in:
@@ -6,6 +6,8 @@ dependencies {
|
||||
// NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
modImplementation("unimaven.curseforge:playerrevive-266890:${player_revive}")
|
||||
modImplementation("unimaven.curseforge:creativecore-257814:${creative_core}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
|
@@ -2,6 +2,8 @@ package com.hypherionmc.craterlib.common;
|
||||
|
||||
import com.hypherionmc.craterlib.core.platform.CompatUtils;
|
||||
import com.hypherionmc.craterlib.nojang.world.entity.player.BridgedPlayer;
|
||||
import team.creative.playerrevive.api.IBleeding;
|
||||
import team.creative.playerrevive.server.PlayerReviveServer;
|
||||
|
||||
public class ForgeCompatHelper implements CompatUtils {
|
||||
|
||||
@@ -14,4 +16,30 @@ public class ForgeCompatHelper implements CompatUtils {
|
||||
public String getSkinUUID(BridgedPlayer player) {
|
||||
return player.getStringUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayerBleeding(BridgedPlayer player) {
|
||||
if (!ModloaderEnvironment.INSTANCE.isModLoaded("playerrevive"))
|
||||
return false;
|
||||
|
||||
return PlayerReviveServer.isBleeding(player.toMojangServerPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerBledOut(BridgedPlayer player) {
|
||||
if (!ModloaderEnvironment.INSTANCE.isModLoaded("playerrevive"))
|
||||
return false;
|
||||
|
||||
IBleeding bleeding = PlayerReviveServer.getBleeding(player.toMojangServerPlayer());
|
||||
return bleeding != null && bleeding.bledOut();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerRevived(BridgedPlayer player) {
|
||||
if (!ModloaderEnvironment.INSTANCE.isModLoaded("playerrevive"))
|
||||
return false;
|
||||
|
||||
IBleeding bleeding = PlayerReviveServer.getBleeding(player.toMojangServerPlayer());
|
||||
return bleeding != null && bleeding.revived();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user