uncomment prism support

This commit is contained in:
Telesphoreo 2024-01-23 19:52:03 -06:00
parent 72467de5ce
commit 8f713fd30c
No known key found for this signature in database
GPG Key ID: 9D1991811E093C02
4 changed files with 34 additions and 16 deletions

View File

@ -10,7 +10,7 @@ plugins {
repositories { repositories {
maven(url = uri("https://maven.playpro.com")) maven(url = uri("https://maven.playpro.com"))
// maven(url = uri("https://nexus.darkhelmet.network/repository/maven-snapshots")) maven(url = uri("https://nexus.telesphoreo.me/repository/plex-modules/"))
} }
dependencies { dependencies {
@ -28,7 +28,7 @@ dependencies {
exclude("org.bukkit", "bukkit") exclude("org.bukkit", "bukkit")
} }
compileOnly("net.coreprotect:coreprotect:22.2") compileOnly("net.coreprotect:coreprotect:22.2")
// compileOnly("network.darkhelmet:prism:3.3.1") compileOnly("network.darkhelmet.prism:Prism-Api:1.0.0")
implementation("org.bstats:bstats-base:3.0.2") implementation("org.bstats:bstats-base:3.0.2")
implementation("org.bstats:bstats-bukkit:3.0.2") implementation("org.bstats:bstats-bukkit:3.0.2")

View File

@ -6,7 +6,7 @@ import dev.plex.config.Config;
import dev.plex.handlers.CommandHandler; import dev.plex.handlers.CommandHandler;
import dev.plex.handlers.ListenerHandler; import dev.plex.handlers.ListenerHandler;
import dev.plex.hook.CoreProtectHook; import dev.plex.hook.CoreProtectHook;
//import dev.plex.hook.PrismHook; import dev.plex.hook.PrismHook;
import dev.plex.module.ModuleManager; import dev.plex.module.ModuleManager;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.punishment.PunishmentManager; import dev.plex.punishment.PunishmentManager;
@ -17,9 +17,14 @@ import dev.plex.storage.StorageType;
import dev.plex.storage.player.SQLPlayerData; import dev.plex.storage.player.SQLPlayerData;
import dev.plex.storage.punishment.SQLNotes; import dev.plex.storage.punishment.SQLNotes;
import dev.plex.storage.punishment.SQLPunishment; import dev.plex.storage.punishment.SQLPunishment;
import dev.plex.util.*; import dev.plex.util.BuildInfo;
import dev.plex.util.BungeeUtil;
import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils;
import dev.plex.util.UpdateChecker;
import dev.plex.util.redis.MessageUtil; import dev.plex.util.redis.MessageUtil;
import dev.plex.world.CustomWorld; import dev.plex.world.CustomWorld;
import java.io.File;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.chat.Chat;
@ -29,8 +34,6 @@ import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
@Getter @Getter
@Setter @Setter
public class Plex extends JavaPlugin public class Plex extends JavaPlugin
@ -62,7 +65,7 @@ public class Plex extends JavaPlugin
private Chat chat; private Chat chat;
private CoreProtectHook coreProtectHook; private CoreProtectHook coreProtectHook;
// private PrismHook prismHook; private PrismHook prismHook;
public static Plex get() public static Plex get()
{ {
@ -131,15 +134,24 @@ public class Plex extends JavaPlugin
permissions = setupPermissions(); permissions = setupPermissions();
chat = setupChat(); chat = setupChat();
if (plugin.getServer().getPluginManager().isPluginEnabled("CoreProtect")) { if (plugin.getServer().getPluginManager().isPluginEnabled("CoreProtect"))
{
PlexLog.log("Hooked into CoreProtect!"); PlexLog.log("Hooked into CoreProtect!");
coreProtectHook = new CoreProtectHook(this); coreProtectHook = new CoreProtectHook(this);
} else { }
else
{
PlexLog.debug("Not hooking into CoreProtect"); PlexLog.debug("Not hooking into CoreProtect");
} }
// if (plugin.getServer().getPluginManager().isPluginEnabled("Prism")) { if (plugin.getServer().getPluginManager().isPluginEnabled("Prism"))
// prismHook = new PrismHook(this); {
// } PlexLog.log("Hooked into Prism!");
prismHook = new PrismHook(this);
}
else
{
PlexLog.debug("Not hooking into Prism");
}
updateChecker = new UpdateChecker(); updateChecker = new UpdateChecker();
PlexLog.log("Update checking enabled"); PlexLog.log("Update checking enabled");

View File

@ -15,7 +15,13 @@ import dev.plex.util.BungeeUtil;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import dev.plex.util.TimeUtils; import dev.plex.util.TimeUtils;
import java.time.Instant;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import network.darkhelmet.prism.api.PrismParameters;
import network.darkhelmet.prism.api.Result;
import network.darkhelmet.prism.api.actions.PrismProcessType;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -91,7 +97,7 @@ public class BanCMD extends PlexCommand
if (rollBack) if (rollBack)
{ {
/*if (plugin.getPrismHook().hasPrism()) { if (plugin.getPrismHook().hasPrism()) {
PrismParameters parameters = plugin.getPrismHook().prismApi().createParameters(); PrismParameters parameters = plugin.getPrismHook().prismApi().createParameters();
parameters.addActionType("block-place"); parameters.addActionType("block-place");
parameters.addActionType("block-break"); parameters.addActionType("block-break");
@ -113,7 +119,7 @@ public class BanCMD extends PlexCommand
} }
}); });
} }
else */ else
if (plugin.getCoreProtectHook().hasCoreProtect()) if (plugin.getCoreProtectHook().hasCoreProtect())
{ {
PlexLog.debug("Testing coreprotect"); PlexLog.debug("Testing coreprotect");

View File

@ -1,7 +1,7 @@
/*
package dev.plex.hook; package dev.plex.hook;
import dev.plex.Plex; import dev.plex.Plex;
import network.darkhelmet.prism.api.PrismApi;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
public class PrismHook public class PrismHook
@ -31,4 +31,4 @@ public class PrismHook
return prismApi; return prismApi;
} }
} }
*/