当前位置: 首页>>代码示例>>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;未经允许,请勿转载。