2.0.2
This commit is contained in:
parent
779420568e
commit
3083f98cf6
|
@ -26,9 +26,10 @@ public class PvpMain extends JavaPlugin {
|
||||||
getServer().getPluginManager().registerEvents(new OperateGui(), this);
|
getServer().getPluginManager().registerEvents(new OperateGui(), this);
|
||||||
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
|
/*Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
|
||||||
getPlayerManager().carryOutCheckTime();
|
getPlayerManager().carryOutCheckTime();
|
||||||
},100L,20L * 60);
|
},100L,20L * 60);
|
||||||
|
*/
|
||||||
DataRefreshUtil.createRefreshDataRecord("PvpProtectDaily");
|
DataRefreshUtil.createRefreshDataRecord("PvpProtectDaily");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
src/main/java/com/yaohun/pvpprotect/api/ProtectAPI.java
Normal file
16
src/main/java/com/yaohun/pvpprotect/api/ProtectAPI.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
public static int default_hour = 12;
|
public static final int default_hour = 24;
|
||||||
public static LangData langData;
|
public static LangData langData;
|
||||||
private static HashMap<String, GuiItemData> guiItemDataMap = new HashMap<>();
|
private static HashMap<String, GuiItemData> guiItemDataMap = new HashMap<>();
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class Config {
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
FileConfiguration config = plugin.getConfig();
|
FileConfiguration config = plugin.getConfig();
|
||||||
default_hour = config.getInt("DefaultHour",12);
|
// default_hour = config.getInt("DefaultHour",12);
|
||||||
loadGuiItemData(config);
|
loadGuiItemData(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ public class PlayerListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBossDiscover(EntityDamageByEntityEvent e) {
|
public void onBossDiscover(EntityDamageByEntityEvent e) {
|
||||||
if (!(e.getDamager() instanceof Player)) {
|
if (!(e.getDamager() instanceof Player)) {
|
||||||
|
@ -82,4 +83,5 @@ public class PlayerListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: DemonPvpProtect
|
name: DemonPvpProtect
|
||||||
main: com.yaohun.pvpprotect.PvpMain
|
main: com.yaohun.pvpprotect.PvpMain
|
||||||
version: 2.0.0
|
version: 2.0.2
|
||||||
author: yaohun
|
author: yaohun
|
||||||
commands:
|
commands:
|
||||||
pvp:
|
pvp:
|
Loading…
Reference in New Issue
Block a user