本文整理汇总了Java中com.massivecraft.factions.Factions类的典型用法代码示例。如果您正苦于以下问题:Java Factions类的具体用法?Java Factions怎么用?Java Factions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Factions类属于com.massivecraft.factions包,在下文中一共展示了Factions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCmdFactions
import com.massivecraft.factions.Factions; //导入依赖的package包/类
public com.massivecraft.factions.cmd.CmdFactions getCmdFactions() {
if (this.cmdFactionsInstance == null) {
try {
Method getMethod = com.massivecraft.factions.Factions.class.getMethod("get");
Factions factionsInstance = (Factions) getMethod.invoke(null);
Field field = com.massivecraft.factions.Factions.class.getDeclaredField("outerCmdFactions");
field.setAccessible(true);
this.cmdFactionsInstance = (com.massivecraft.factions.cmd.CmdFactions) field.get(factionsInstance);
} catch(Exception e) {
FactionsFramework.get().err(e);
return null;
}
}
return this.cmdFactionsInstance;
}
示例2: getCmdFactions
import com.massivecraft.factions.Factions; //导入依赖的package包/类
public com.massivecraft.factions.cmd.CmdFactions getCmdFactions() {
if (this.cmdFactionsInstance == null) {
try {
Method getMethod = com.massivecraft.factions.Factions.class.getMethod("get");
Factions factionsInstance = (Factions) getMethod.invoke(null);
Field field = com.massivecraft.factions.Factions.class.getDeclaredField("outerCmdFactions");
field.setAccessible(true);
this.cmdFactionsInstance = (com.massivecraft.factions.cmd.CmdFactions) field.get(factionsInstance);
} catch(Exception e) {
FactionsFramework.get().err(e);
return null;
}
}
return this.cmdFactionsInstance;
}
示例3: add
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public void add(FactionsCommand command) {
Command_2_8_2 nativeCommand = new Command_2_8_2(command);
this.cmdMap.put(command, nativeCommand);
Factions.get().getOuterCmdFactions().addSubCommand(nativeCommand);
}
示例4: onClaim
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onClaim(LandUnclaimAllEvent event) {
Multimap<String, ChunkPos> claims = HashMultimap.create();
flocationIds.entrySet().stream()
.filter(entry -> entry.getValue().getHostFaction() == event.getFaction())
.forEach(entry -> claims.put(event.getFactionId(), getChunkPos(entry.getKey())));
callEvent(new FactionClaimEvent(Factions.i.getNone().getId(), claims));
}
示例5: onEnable
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public void onEnable() {
getOrRegisterDownloadPerm();
getServer().getPluginManager().registerEvents(this, this);
try {
class StringPlotter extends Plotter {
public StringPlotter(String str) {
super(str);
}
@Override
public int getValue() {
return 1;
}
}
Metrics metrics = new Metrics(this);
Graph factionsVersionGraph = metrics.createGraph("factionsVersion");
String factionsVersion = getProvidingPlugin(Factions.class)
.getDescription().getFullName();
factionsVersionGraph.addPlotter(new StringPlotter(factionsVersion));
Graph massiveCoreVersionGraph = metrics.createGraph("massiveCoreVersion");
String massiveCoreVersion = getProvidingPlugin(MassiveCore.class)
.getDescription().getFullName();
massiveCoreVersionGraph.addPlotter(new StringPlotter(massiveCoreVersion));
Graph wdlcVersionGraph = metrics.createGraph("wdlcompanionVersion");
String wdlcVersion = getProvidingPlugin(IRangeProducer.class)
.getDescription().getFullName();
wdlcVersionGraph.addPlotter(new StringPlotter(wdlcVersion));
metrics.start();
} catch (Exception e) {
getLogger().warning("Failed to start PluginMetrics :(");
}
}
示例6: FactionsHandler
import com.massivecraft.factions.Factions; //导入依赖的package包/类
public FactionsHandler(Factions plugin) {
this.plugin = plugin;
if (plugin != null) {
Bukkit.getPluginManager().registerEvents(new FactionsListener(), Gringotts.G);
Gringotts.G.registerAccountHolderProvider("faction", this);
}
}
示例7: checkHook
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public boolean checkHook() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("Factions");
if (plugin != null && plugin instanceof Factions) {
Zephyrus.getPlugin().getLogger().info("[Plugin Hooks] Found and hooked Factions");
return true;
}
return false;
}
示例8: canLoad
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public boolean canLoad() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("Factions");
if (plugin != null && plugin instanceof Factions) {
return true;
}
return false;
}
示例9: setupFactions
import com.massivecraft.factions.Factions; //导入依赖的package包/类
public void setupFactions() {
Factions factions = ( Factions ) Bukkit.getPluginManager().getPlugin( "Factions" );
if ( factions != null ) {
if ( !factions.getDescription().getVersion().startsWith( "1" ) ) {
Bukkit.getConsoleSender().sendMessage( ChatColor.GREEN + "Factions detected, hooking in!" );
factionChat = true;
getCommand( "factionchat" ).setExecutor( new FactionChatCommand() );
getCommand( "factionchatally" ).setExecutor( new FactionChatAllyCommand() );
getCommand( "factionchatfaction" ).setExecutor( new FactionChatFactionCommand() );
}
}
}
示例10: isInClaimedLand
import com.massivecraft.factions.Factions; //导入依赖的package包/类
public static boolean isInClaimedLand(Location l) {
Faction f = BoardColl.get().getFactionAt(PS.valueOf(l));
if (f == null)
return false;
String id = f.getId();
if (id.equals(Factions.ID_NONE) || id.equals(Factions.ID_SAFEZONE) || id.equals(Factions.ID_WARZONE)) {
return false;
}
return true;
}
示例11: setupFactions
import com.massivecraft.factions.Factions; //导入依赖的package包/类
private void setupFactions() {
if (config.Settings_Factions) {
Plugin fPlugin = getServer().getPluginManager().getPlugin("Factions");
if (fPlugin != null && fPlugin instanceof Factions) {
factions = (Factions)fPlugin;
getLogger().info("Factions detected. Enabling Factions Chat.");
} else {
factions = null;
getLogger().info("Factions not found. Factions Chat disabled.");
}
} else {
factions = null;
}
}
示例12: remove
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public void remove(FactionsCommand command) {
Factions.get().getOuterCmdFactions().removeSubCommand(this.cmdMap.get(command));
this.cmdMap.remove(command);
}
示例13: getFactionAt
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public String getFactionAt(String worldName, int chunkX, int chunkZ) {
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(worldName, chunkX, chunkZ));
return faction == null ? Factions.ID_NONE : faction.getId();
}
示例14: getFactionName
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public String getFactionName(String factionId) {
return Factions.i.get(factionId).getTag();
}
示例15: isFaction
import com.massivecraft.factions.Factions; //导入依赖的package包/类
@Override
public boolean isFaction(String factionId) {
return Factions.i.get(factionId) != null;
}