当前位置: 首页>>代码示例>>Java>>正文


Java LogBlock类代码示例

本文整理汇总了Java中de.diddiz.LogBlock.LogBlock的典型用法代码示例。如果您正苦于以下问题:Java LogBlock类的具体用法?Java LogBlock怎么用?Java LogBlock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LogBlock类属于de.diddiz.LogBlock包,在下文中一共展示了LogBlock类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logBlockHasDatabase

import de.diddiz.LogBlock.LogBlock; //导入依赖的package包/类
private boolean logBlockHasDatabase(LogBlock lb)
{
	try
	{
		Field f = lb.getClass().getDeclaredField("noDb");
		f.setAccessible(true);
		boolean noDb = f.getBoolean(lb);
		
		return !noDb;
	}
	catch (Exception e)
	{
		getLogger().warning("Impossible de recuperer les informations de base de donnees de LogBlock: il est possible que le rollback de ne fonctionne pas");
	}
	
	return true;
}
 
开发者ID:riking,项目名称:GrandVide,代码行数:18,代码来源:GrandVide.java

示例2: setPlugin

import de.diddiz.LogBlock.LogBlock; //导入依赖的package包/类
@Override
public boolean setPlugin(Plugin plugin){
    if (plugin == null) return false;

    if (plugin instanceof LogBlock){
        this.logblock = (LogBlock) plugin;
        return true;
    }

    return false;
}
 
开发者ID:MCBans,项目名称:MCBansAssetGatway,代码行数:12,代码来源:LbRollback.java

示例3: execute

import de.diddiz.LogBlock.LogBlock; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void execute(Event e) {

	LogBlock logblock = (LogBlock) Bukkit.getServer().getPluginManager().getPlugin("LogBlock");
	Consumer con = logblock.getConsumer();
	String a = player.getSingle(e).getName();

	if (markr == 1) {
		con.queueBlockBreak(a, loc.getSingle(e), loc.getSingle(e).getBlock().getTypeId(),
				loc.getSingle(e).getBlock().getData());
	} else if (markr == 2) {
		con.queueBlockPlace(a, loc.getSingle(e), loc.getSingle(e).getBlock().getTypeId(),
				loc.getSingle(e).getBlock().getData());
	} else if (markr == 3) {
		if (previ != null & newi != null) {
			con.queueBlockReplace(a, loc.getSingle(e), previ.getSingle(e).getType().getId(),
					previ.getSingle(e).getData().getData(), newi.getSingle(e).getTypeId(),
					newi.getSingle(e).getData().getData());
		} else {

			QueryParams params = new QueryParams(logblock);
			params.setPlayer(player.getSingle(e).getName());
			params.bct = BlockChangeType.BOTH;
			params.limit = -1;
			params.world = loc.getSingle(e).getWorld();
			params.needDate = true;
			params.needType = true;
			params.needData = true;
			params.needPlayer = true;
			int oldstate = 0;
			byte oldstate2 = 0;
			try {
				for (BlockChange bc : logblock.getBlockChanges(params)) {
					oldstate = bc.type;
					oldstate2 = bc.data;
					break;
				}
			} catch (SQLException ex) {

			}
			con.queueBlockReplace(a, loc.getSingle(e), oldstate, oldstate2, loc.getSingle(e).getBlock().getTypeId(),
					loc.getSingle(e).getBlock().getData());

		}
	}

}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:49,代码来源:EffQueueLog.java

示例4: setupHandler

import de.diddiz.LogBlock.LogBlock; //导入依赖的package包/类
/**
 * Setup and select rollback method
 * @return true if integration plugin found
 */
public boolean setupHandler(){
    PluginManager pm = plugin.getServer().getPluginManager();

    // Check LogBlock
    Plugin check = pm.getPlugin("LogBlock");
    if (check != null && check instanceof LogBlock && check.isEnabled()) {
        method = new LbRollback(plugin);
        if (method.setPlugin(check)){
            log.info("LogBlock plugin found. Using this for rollback.");
            return true;
        }
    }

    // Check HawkEye
    check = pm.getPlugin("HawkEye");
    if (check != null && check instanceof HawkEye && check.isEnabled()) {
        method = new HeRollback(plugin);
        log.info("HawkEye plugin found. Using this for rollback.");
        return true;
    }

    // Check CoreProtect
    check = pm.getPlugin("CoreProtect");
    if (check != null && check instanceof CoreProtect && check.isEnabled()) {
        CoreProtectAPI cpAPI = ((CoreProtect) check).getAPI();
        if (cpAPI.isEnabled()){
            method = new CpRollback(plugin);
            method.setPlugin(check);
            log.info("CoreProtect plugin found. Using this for rollback.");
            return true;
        }else{
            log.info("CoreProtect plugin found but disabled API.");
            log.info("Change 'api-enabled' value of CoreProtect config.yml and restart server!");
        }
    }

    log.info("Rollback plugin not found!");
    method = null;

    return false;
}
 
开发者ID:MCBans,项目名称:MCBansAssetGatway,代码行数:46,代码来源:RollbackHandler.java

示例5: LogBlockRollback

import de.diddiz.LogBlock.LogBlock; //导入依赖的package包/类
public LogBlockRollback(Plugin plugin) {
    this.logBlock = (LogBlock) plugin;
    UG.getInstance().getLogger().info("LogBlock found! Enabling rollback support");
}
 
开发者ID:UltimateGames,项目名称:UltimateGames,代码行数:5,代码来源:LogBlockRollback.java


注:本文中的de.diddiz.LogBlock.LogBlock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。