This commit is contained in:
yaohunya 2025-08-10 04:06:13 +08:00
parent 779420568e
commit 3083f98cf6
5 changed files with 23 additions and 4 deletions

View File

@ -26,9 +26,10 @@ public class PvpMain extends JavaPlugin {
getServer().getPluginManager().registerEvents(new OperateGui(), this);
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
/*Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
getPlayerManager().carryOutCheckTime();
},100L,20L * 60);
*/
DataRefreshUtil.createRefreshDataRecord("PvpProtectDaily");
}

View File

@ -0,0 +1,16 @@
package com.yaohun.pvpprotect.api;
import com.yaohun.pvpprotect.PvpMain;
import com.yaohun.pvpprotect.manage.PlayerManager;
public class ProtectAPI {
// 判断玩家是否开启竞技保护
public static boolean hasPvpProtect(String playerName) {
PlayerManager playerManager = PvpMain.getPlayerManager();
if (playerManager.isPlayerOpened(playerName)) {
return true;
}
return false;
}
}

View File

@ -12,7 +12,7 @@ import java.util.HashMap;
public class Config {
public static int default_hour = 12;
public static final int default_hour = 24;
public static LangData langData;
private static HashMap<String, GuiItemData> guiItemDataMap = new HashMap<>();
@ -22,7 +22,7 @@ public class Config {
plugin.reloadConfig();
plugin.saveConfig();
FileConfiguration config = plugin.getConfig();
default_hour = config.getInt("DefaultHour",12);
// default_hour = config.getInt("DefaultHour",12);
loadGuiItemData(config);
}

View File

@ -59,6 +59,7 @@ public class PlayerListener implements Listener {
}
}
/*
@EventHandler
public void onBossDiscover(EntityDamageByEntityEvent e) {
if (!(e.getDamager() instanceof Player)) {
@ -82,4 +83,5 @@ public class PlayerListener implements Listener {
}
}
}
*/
}

View File

@ -1,6 +1,6 @@
name: DemonPvpProtect
main: com.yaohun.pvpprotect.PvpMain
version: 2.0.0
version: 2.0.2
author: yaohun
commands:
pvp: