當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldGuardPlugin.inst方法代碼示例

本文整理匯總了Java中com.sk89q.worldguard.bukkit.WorldGuardPlugin.inst方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldGuardPlugin.inst方法的具體用法?Java WorldGuardPlugin.inst怎麽用?Java WorldGuardPlugin.inst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sk89q.worldguard.bukkit.WorldGuardPlugin的用法示例。


在下文中一共展示了WorldGuardPlugin.inst方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
@Override
public void run() {
	if(wg == null){
		wg = WorldGuardPlugin.inst();
	}
	if(rm == null ){
		rm = wg.getRegionManager(Bukkit.getWorld(Bukkit.getServerName()));
	}
	System.out.println("Updating scores.");
	final Collection<? extends Player> players = Bukkit.getOnlinePlayers();
	for(Player p : players){
		if(p != null){
			ApplicableRegionSet set = rm.getApplicableRegions(p.getLocation());
			for(ProtectedRegion r : set){
				if(r.getId().equalsIgnoreCase("OriginStation")){
					p.sendMessage("Your score was not updated because you are in the spawn no-pvp zone.");
					continue;
				}
			}
			SQLDatabase.addScore(p.getUniqueId(), 1);
		}
	}
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:24,代碼來源:ScoreUpdateTask.java

示例2: getPluginDepends

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
private boolean getPluginDepends() {

        if (this.getServer().getPluginManager().getPlugin("WorldEdit") == null) {
            this.getLogger().severe("Error: " + "WorldEdit not found!");
            return false;
        }

        if (this.getServer().getPluginManager().getPlugin("WorldGuard") == null) {
            this.getLogger().severe("Error: " + "WorldGuard not found!");
            return false;
        }

        if (this.getServer().getPluginManager().getPlugin("Vault") == null) {
            this.getLogger().severe("Error: " + "Vault not found!");
            return false;
        }

        this.wgPl = WorldGuardPlugin.inst();
        this.wePl = WorldEdit.getInstance();

        return true;
    }
 
開發者ID:MineGaming,項目名稱:cubit,代碼行數:23,代碼來源:CubitBukkitPlugin.java

示例3: registerWorldGuardFlag

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
private void registerWorldGuardFlag() {
    if (getConfig().getBoolean("useWorldGuardFlags")) {
        if (getServer().getPluginManager().isPluginEnabled("WorldGuard")) {
            getLogger().warning("Using world guards flags requires the plugin WorldGuard");
        } else {
            regionsWhitelist = new WorldGuardFlagSupport(WorldGuardPlugin.inst());
            regionsWhitelist.registerWorldGuardFlag();
        }
    }
}
 
開發者ID:games647,項目名稱:mcMMOExtras,代碼行數:11,代碼來源:McMMOExtras.java

示例4: get

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
public static WorldGuardPlugin get() {
  try {
    Class.forName("com.sk89q.worldguard.bukkit.WorldGuardPlugin");
    return WorldGuardPlugin.inst();
  } catch (ClassNotFoundException e) {
    return null;
  }
}
 
開發者ID:SupaHam,項目名稱:NPCs,代碼行數:9,代碼來源:WGUtils.java

示例5: onEnable

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void onEnable() {
    saveDefaultConfig();

    CodecRegistry codecRegistry = createCodecRegistry();
    MongoClientSettings settings = MongoClientSettings.builder()
            .clusterSettings(ClusterSettings.builder().applyConnectionString(new ConnectionString(getConfig().getString("mongodb.uri"))).build())
            .codecRegistry(codecRegistry)
            .build();
    client = MongoClients.create(settings);
    MongoDatabase database = client.getDatabase(getConfig().getString("mongodb.database"));
    if (!testConnection(database))
        return;
    RegionStorageAdapter storageAdapter = new RegionStorageAdapter(database);
    MongoRegionDriver driver = new MongoRegionDriver(getServer(), storageAdapter);

    WorldGuardPlugin wgPlugin = WorldGuardPlugin.inst();
    if (getConfig().getBoolean("mongodb.use_oplog")) {
        getLogger().info("OpLog usage enabled.");
        WorldGuardOpLogHandler opLogHandler = new WorldGuardOpLogHandler(codecRegistry.get(ProcessingProtectedRegion.class), storageAdapter, wgPlugin);
        getServer().getScheduler().runTaskAsynchronously(this, new OpLogRetriever(
                OpLogUtils.getCollection(client),
                new OpLogParser(opLogHandler),
                getConfig().getString("mongodb.database") + "." + RegionStorageAdapter.COLLECTION_NAME
        ));
        storageAdapter.setListener(opLogHandler);
    }

    ConfigurationManager config = wgPlugin.getGlobalStateManager();
    RegionContainer container = wgPlugin.getRegionContainer();
    InjectionUtils.injectRegionDriver(container, driver);
    InjectionUtils.callUnload(container);
    InjectionUtils.callLoadWorlds(container);
    config.selectedRegionStoreDriver = driver;
}
 
開發者ID:maxikg,項目名稱:mongowg,代碼行數:39,代碼來源:MongoWGPlugin.java

示例6: onEnable

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
public void onEnable(){
	saveDefaultConfig();
	wg = WorldGuardPlugin.inst();
	rm = wg.getRegionManager(Bukkit.getWorld(Bukkit.getServerName()));
	for(String key : getConfig().getKeys(false)){
		Port p = new Port(getConfig(), key, rm);
		if(p.region != null){
			ports.add(p);
			System.out.println("port added: " + p.name);
		}
	}
	PortTask t = new PortTask();
	int delay = PortTask.getIntervalShipLeavesEvery(20 * 60);
	t.runTaskTimer(this, delay, delay);
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:16,代碼來源:SQPorts.java

示例7: onCommand

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
public void onCommand(MCPlayerCommandEvent event) {
	WorldGuardPlayerListener wgpl = new WorldGuardPlayerListener(WorldGuardPlugin.inst());
	wgpl.onPlayerCommandPreprocess((PlayerCommandPreprocessEvent) event._GetObject());
}
 
開發者ID:jb-aero,項目名稱:SKCompat,代碼行數:5,代碼來源:SKEvents.java

示例8: WorldGuardListener

import com.sk89q.worldguard.bukkit.WorldGuardPlugin; //導入方法依賴的package包/類
public WorldGuardListener() {
	worldGuardPlugin = WorldGuardPlugin.inst();
	
	SimpleTownsXtras.log("WorldGuard features enabled.");
}
 
開發者ID:markhughes,項目名稱:SimpleTowns-xtras,代碼行數:6,代碼來源:WorldGuardListener.java


注:本文中的com.sk89q.worldguard.bukkit.WorldGuardPlugin.inst方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。