• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Towny类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initDependencies

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
private void initDependencies() {
    PluginManager pm = getServer().getPluginManager();
    heroes = (Heroes) pm.getPlugin("Heroes");

    Plugin townyPlugin = pm.getPlugin("Towny");
    if (townyPlugin != null && townyPlugin instanceof Towny) {
        towny = new TownyFacade((Towny) townyPlugin);
        usingTowny = true;
        Messaging.log("Linked with Towny");
    }

    Plugin worldGuardPlugin = pm.getPlugin("WorldGuard");
    if (worldGuardPlugin != null && worldGuardPlugin instanceof WorldGuardPlugin) {
        worldGuard = new WorldGuardFacade((WorldGuardPlugin) worldGuardPlugin);
        usingWorldGuard = true;
        Messaging.log("Linked with WorldGuard");
    }
}
 
开发者ID:galaran,项目名称:PvpRealm,代码行数:19,代码来源:PvpRealm.java


示例2: isAvailable

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
/**
 * Tests if the Towny plugin is installed.
 *
 * @return True if the factions plugin is installed, false otherwise.
 */
public static boolean isAvailable() {
    try {
        JavaPlugin.getProvidingPlugin(Towny.class);
        return true;
    } catch (NoClassDefFoundError e) {
        return false;
    }
}
 
开发者ID:rutgerkok,项目名称:BlockLocker,代码行数:14,代码来源:TownyGroupSystem.java


示例3: checkHook

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
@Override
public boolean checkHook() {
	Plugin plugin = Bukkit.getPluginManager().getPlugin("Towny");
	if (plugin != null && plugin instanceof Towny) {
		Zephyrus.getPlugin().getLogger().info("[Plugin Hooks] Found and hooked Towny");
		return true;
	}
	return false;
}
 
开发者ID:mcardy,项目名称:Zephyrus-II,代码行数:10,代码来源:TownyHook.java


示例4: canLoad

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
@Override
public boolean canLoad() {
	Plugin plugin = Bukkit.getPluginManager().getPlugin("Towny");
	if (plugin != null && plugin instanceof Towny) {
		return true;
	}
	return false;
}
 
开发者ID:mcardy,项目名称:ProtectionsLib,代码行数:9,代码来源:TownyProtection.java


示例5: TownyHook

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
public TownyHook(ConditionalPerms plugin) {
    super(plugin);
    towny = (Towny) getPlugin().getServer().getPluginManager().getPlugin("Towny");
}
 
开发者ID:lucko,项目名称:ConditionalPerms,代码行数:5,代码来源:TownyHook.java


示例6: onEnable

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
@Override
public void onEnable() {
	Instance = this;

	TBMCCoreAPI.RegisterEventsForExceptions(new PlayerListener(), this);
	TBMCChatAPI.AddCommands(this, YeehawCommand.class);
	Console = this.getServer().getConsoleSender();
	LoadFiles();

	SB = getServer().getScoreboardManager().getMainScoreboard(); // Main can be detected with @a[score_...]
	TU = ((Towny) Bukkit.getPluginManager().getPlugin("Towny")).getTownyUniverse();
	Towns = new ArrayList<Town>(TU.getTownsMap().values()); // Creates a snapshot of towns, new towns will be added when needed
	Nations = new ArrayList<Nation>(TU.getNationsMap().values()); // Same here but with nations

	TownColors.keySet().removeIf(t -> !TU.getTownsMap().containsKey(t.toLowerCase())); // Removes town colors for deleted/renamed towns

	TBMCChatAPI.RegisterChatChannel(
			TownChat = new Channel("§3TC§f", Color.DarkAqua, "tc", s -> checkTownNationChat(s, false)));
	TBMCChatAPI.RegisterChatChannel(
			NationChat = new Channel("§6NC§f", Color.Gold, "nc", s -> checkTownNationChat(s, true)));
	TBMCChatAPI.RegisterChatChannel(RPChannel = new Channel("§7RP§f", Color.Gray, "rp", Channel.noScoreResult(s -> {
		if (s instanceof ConsoleCommandSender)
			return true;
		return true; // TODO: Allow hiding it
	}, "You need to show the RP chat in order to speak in it.")));

	Bukkit.getScheduler().runTask(this, () -> {
		val dtp = (DynmapTownyPlugin) Bukkit.getPluginManager().getPlugin("Dynmap-Towny");
		if (dtp == null)
			return;
		for (val entry : TownColors.entrySet())
			setTownColor(dtp, entry.getKey(), entry.getValue());
	});

	setupChat();
	setupEconomy();
	setupPermissions();

	new Thread(this::FlairGetterThreadMethod).start();
	new Thread(new AnnouncerThread()).start();
}
 
开发者ID:TBMCPlugins,项目名称:ButtonChat,代码行数:42,代码来源:PluginMain.java


示例7: ValidTownyHandler

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
public ValidTownyHandler(Towny plugin) {
    this.plugin = plugin;
    Bukkit.getPluginManager().registerEvents(new TownyListener(), Gringotts.G);
    Gringotts.G.registerAccountHolderProvider("town", this);
    Gringotts.G.registerAccountHolderProvider("nation", this);
}
 
开发者ID:sakunc,项目名称:Gringotts-,代码行数:7,代码来源:TownyHandler.java


示例8: loadExternalPlugins

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
private void loadExternalPlugins() {
    if (worldGuard != null && !WorldGuardShopFlag.isLoaded()) {
        WorldGuardShopFlag.register(this, false);

        try {
            // Reload WorldGuard regions, so that custom flags are applied
            for (World world : getServer().getWorlds()) {
                worldGuard.getRegionManager(world).load();
            }
        } catch (Exception e) {
            getLogger().severe("Failed to reload WorldGuard region manager. WorldGuard support will probably not work!");
            debug("Failed to load WorldGuard region manager");
            debug(e);
        }
    }

    Plugin townyPlugin = Bukkit.getServer().getPluginManager().getPlugin("Towny");
    if (townyPlugin instanceof Towny) {
        towny = (Towny) townyPlugin;
    }

    Plugin authMePlugin = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
    if (authMePlugin instanceof AuthMe) {
        authMe = (AuthMe) authMePlugin;
    }

    Plugin uSkyBlockPlugin = Bukkit.getServer().getPluginManager().getPlugin("uSkyBlock");
    if (uSkyBlockPlugin instanceof uSkyBlockAPI) {
        uSkyBlock = (uSkyBlockAPI) uSkyBlockPlugin;
    }

    Plugin aSkyBlockPlugin = Bukkit.getServer().getPluginManager().getPlugin("ASkyBlock");
    if (aSkyBlockPlugin instanceof ASkyBlock) {
        aSkyBlock = (ASkyBlock) aSkyBlockPlugin;
    }

    Plugin islandWorldPlugin = Bukkit.getServer().getPluginManager().getPlugin("IslandWorld");
    if (islandWorldPlugin instanceof IslandWorld) {
        islandWorld = (IslandWorld) islandWorldPlugin;
    }

    Plugin griefPreventionPlugin = Bukkit.getServer().getPluginManager().getPlugin("GriefPrevention");
    if (griefPreventionPlugin instanceof GriefPrevention) {
        griefPrevention = (GriefPrevention) griefPreventionPlugin;
    }

    Plugin areaShopPlugin = Bukkit.getServer().getPluginManager().getPlugin("AreaShop");
    if (areaShopPlugin instanceof AreaShop) {
        areaShop = (AreaShop) areaShopPlugin;
    }

    if (hasPlotSquared()) {
        new PlotSquaredShopFlag().register(this);
    }
}
 
开发者ID:EpicEricEE,项目名称:ShopChest,代码行数:56,代码来源:ShopChest.java


示例9: setupHook

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
@Override
public void setupHook() {
	this.towny = (Towny) Bukkit.getPluginManager().getPlugin("Towny");
}
 
开发者ID:mcardy,项目名称:Zephyrus-II,代码行数:5,代码来源:TownyHook.java


示例10: load

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
@Override
public void load() {
	this.towny = (Towny) Bukkit.getPluginManager().getPlugin("Towny");
}
 
开发者ID:mcardy,项目名称:ProtectionsLib,代码行数:5,代码来源:TownyProtection.java


示例11: RegisterPlugins

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
private void RegisterPlugins(){
    Towny towny = ((Towny)getServer().getPluginManager().getPlugin("Towny"));
    if (towny != null) {
        if (getConfigInfo().isTowny()) {
            log("Towny Registered!", false);
            getProtectionManager().RegisterPlugin(new TownyPlugin(towny));
        }else{
            log("Towny Found but disabled!", false);
            getProtectionManager().UnloadPlugin("Towny");
        }
    }

    WorldGuardPlugin worldGuard = (WorldGuardPlugin) getServer().getPluginManager().getPlugin("WorldGuard");
    if (worldGuard != null) {
        if (getConfigInfo().isWorldguard()) {
            log("WorldGuard Registered!", false);
            getProtectionManager().RegisterPlugin(new WorldguardPlugin(worldGuard));
        }
        else {
            log("WorldGuard Found but disabled!", false);
            getProtectionManager().UnloadPlugin("WorldGuard");
        }
    }

    GriefPrevention griefPrevention = (GriefPrevention) getServer().getPluginManager().getPlugin("GriefPrevention");
    if (griefPrevention != null) {
        if (getConfigInfo().isGriefpreventions()) {
            log("GriefPrevention Registered!", false);
            getProtectionManager().RegisterPlugin(new GriefProtectionPlugin());
        }
        else{
            log("GriefPrevention Found but Disabled!", false);
            getProtectionManager().UnloadPlugin("GriefPrevention");
        }
    }

    Plugin factions = getServer().getPluginManager().getPlugin("Factions");
    if (factions != null) {
        if (getConfigInfo().isFactions()) {
            log("Factions Registered!", false);
            getProtectionManager().RegisterPlugin(new FactionsPlugin());
        }else {
            log("Factions Found but Disabled!", false);
            getProtectionManager().UnloadPlugin("Factions");
        }

    }
}
 
开发者ID:TheFantasyCraft,项目名称:Forge-Permittor,代码行数:49,代码来源:ForgePermittor.java


示例12: TownyPlugin

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
public TownyPlugin(Towny towny){
    this.towny = towny;
}
 
开发者ID:TheFantasyCraft,项目名称:Forge-Permittor,代码行数:4,代码来源:TownyPlugin.java


示例13: TownyFacade

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
public TownyFacade(Towny towny) {
    townyUniv = towny.getTownyUniverse();
}
 
开发者ID:galaran,项目名称:PvpRealm,代码行数:4,代码来源:TownyFacade.java


示例14: getTownyHandler

import com.palmergames.bukkit.towny.Towny; //导入依赖的package包/类
/**
 * Get a valid towny handler if the plugin instance is valid. Otherwise get a fake one.
 * Apparently Towny needs this special treatment, or it will throw exceptions with unavailable classes. 
 * The same doesn't happen with Factions. I wonder why?
 * @param towny Towny plugin instance
 * @return a Towny handler
 */
public static TownyHandler getTownyHandler(Plugin towny) {
    if (towny instanceof Towny)
        return new ValidTownyHandler((Towny)towny);
    else return new InvalidTownyHandler();
}
 
开发者ID:sakunc,项目名称:Gringotts-,代码行数:13,代码来源:TownyHandler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Fields类代码示例发布时间:2022-05-22
下一篇:
Java CreatePartition类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap