本文整理汇总了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;
}
示例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;
}
示例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());
}
}
}
示例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;
}
示例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");
}