org.bukkit.plugin.Plugin#getName ( )源码实例Demo

下面列出了org.bukkit.plugin.Plugin#getName ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TrMenu   文件: Updater.java
public static void init(Plugin plugin) {
    url = "https://api.github.com/repos/Arasple/" + plugin.getName() + "/releases/latest";
    version = TrMenu.getTrVersion();
    newVersion = version;
    setAutoUpdate();

    if (!String.valueOf(version).equalsIgnoreCase(plugin.getDescription().getVersion().split("-")[0])) {
        TLocale.sendToConsole("ERROR.VERSION");
        Bukkit.shutdown();
    }
    Bukkit.getPluginManager().registerEvents(new Updater(), plugin);
}
 
源代码2 项目: PlaceholderAPI   文件: EZPlaceholderHook.java
public EZPlaceholderHook(Plugin plugin, String identifier) {
  Validate.notNull(plugin, "Plugin can not be null!");
  Validate.notNull(identifier, "Placeholder name can not be null!");
  this.identifier = identifier;
  this.plugin = plugin.getName();
}
 
源代码3 项目: TabooLib   文件: TLogger.java
public TLogger(String pattern, Plugin plugin, int level) {
    this.pattern = pattern;
    this.name = plugin.getName();
    this.level = level;
}
 
源代码4 项目: IF   文件: Gui.java
/**
 * Loads a Gui from a given input stream.
 * Throws a {@link RuntimeException} instead of returning null in case of a failure.
 *
 * @param instance the class instance for all reflection lookups
 * @param inputStream the file
 * @return the gui
 * @see #load(Object, InputStream)
 */
@NotNull
public static Gui loadOrThrow(@NotNull Object instance, @NotNull InputStream inputStream) {
    Plugin plugin = JavaPlugin.getProvidingPlugin(Gui.class);
    try {
        Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
        Element documentElement = document.getDocumentElement();

        documentElement.normalize();

        Gui gui = new Gui(plugin, Integer.parseInt(documentElement.getAttribute("rows")), ChatColor
                .translateAlternateColorCodes('&', documentElement.getAttribute("title")));

        if (documentElement.hasAttribute("field"))
            XMLUtil.loadFieldAttribute(instance, documentElement, gui);

        if (documentElement.hasAttribute("onTopClick")) {
            gui.setOnTopClick(XMLUtil.loadOnEventAttribute(instance,
                    documentElement, InventoryClickEvent.class, "onTopClick"));
        }

        if (documentElement.hasAttribute("onBottomClick")) {
            gui.setOnBottomClick(XMLUtil.loadOnEventAttribute(instance,
                    documentElement, InventoryClickEvent.class, "onBottomClick"));
        }

        if (documentElement.hasAttribute("onGlobalClick")) {
            gui.setOnGlobalClick(XMLUtil.loadOnEventAttribute(instance,
                    documentElement, InventoryClickEvent.class, "onGlobalClick"));
        }

        if (documentElement.hasAttribute("onOutsideClick")) {
            gui.setOnOutsideClick(XMLUtil.loadOnEventAttribute(instance,
                    documentElement, InventoryClickEvent.class, "onOutsideClick"));
        }

        if (documentElement.hasAttribute("onClose")) {
            gui.setOnClose(XMLUtil.loadOnEventAttribute(instance,
                    documentElement, InventoryCloseEvent.class, "onClose"));
        }

        if (documentElement.hasAttribute("populate")) {
            MethodUtils.invokeExactMethod(instance, "populate", gui, Gui.class);
        } else {
            NodeList childNodes = documentElement.getChildNodes();
            for (int i = 0; i < childNodes.getLength(); i++) {
                Node item = childNodes.item(i);

                if (item.getNodeType() == Node.ELEMENT_NODE)
                    gui.addPane(loadPane(instance, item));
            }
        }

        return gui;
    } catch (Exception e) {
        throw new XMLLoadException("Error loading " + plugin.getName() + "'s gui with associated class: "
                + instance.getClass().getSimpleName(), e);
    }
}
 
源代码5 项目: FastAsyncWorldedit   文件: PlotMeFeature.java
public PlotMeFeature(final Plugin plotmePlugin, final FaweBukkit p3) {
    super(plotmePlugin.getName());
    this.plotme = ((PlotMe_CorePlugin) plotmePlugin).getAPI();
    this.plugin = p3;

}
 
源代码6 项目: FastAsyncWorldedit   文件: Worldguard.java
public Worldguard(final Plugin p2, final FaweBukkit p3) {
    super(p2.getName());
    this.worldguard = this.getWorldGuard();
    this.plugin = p3;

}
 
源代码7 项目: FastAsyncWorldedit   文件: ASkyBlockHook.java
public ASkyBlockHook(final Plugin aSkyBlock, final FaweBukkit p3) {
    super(aSkyBlock.getName());
    this.aSkyBlock = aSkyBlock;
    this.plugin = p3;

}
 
public GriefPreventionFeature(final Plugin griefpreventionPlugin, final FaweBukkit p3) {
    super(griefpreventionPlugin.getName());
    this.griefprevention = griefpreventionPlugin;
    this.plugin = p3;
}
 
源代码9 项目: FastAsyncWorldedit   文件: FactionsUUIDFeature.java
public FactionsUUIDFeature(final Plugin factionsPlugin, final FaweBukkit p3) {
    super(factionsPlugin.getName());
    this.instance = Board.getInstance();
}
 
源代码10 项目: FastAsyncWorldedit   文件: FactionsFeature.java
public FactionsFeature(final Plugin factionsPlugin, final FaweBukkit p3) {
    super(factionsPlugin.getName());
    this.factions = factionsPlugin;
    this.plugin = p3;
    BoardColl.get();
}
 
源代码11 项目: FastAsyncWorldedit   文件: FactionsOneFeature.java
public FactionsOneFeature(final Plugin factionsPlugin, final FaweBukkit p3) throws Throwable {
    super(factionsPlugin.getName());
    this.clazzBoard = Class.forName("com.massivecraft.factions.Board");
    this.methodGetFactionAt = clazzBoard.getDeclaredMethod("getFactionAt", FLocation.class);
}
 
源代码12 项目: FastAsyncWorldedit   文件: ResidenceFeature.java
public ResidenceFeature(final Plugin residencePlugin, final FaweBukkit p3) {
    super(residencePlugin.getName());
    this.residence = residencePlugin;
    this.plugin = p3;

}
 
源代码13 项目: FastAsyncWorldedit   文件: PreciousStonesFeature.java
public PreciousStonesFeature(final Plugin preciousstonesPlugin, final FaweBukkit p3) {
    super(preciousstonesPlugin.getName());
    this.preciousstones = preciousstonesPlugin;
    this.plugin = p3;

}
 
源代码14 项目: FastAsyncWorldedit   文件: TownyFeature.java
public TownyFeature(final Plugin townyPlugin, final FaweBukkit p3) {
    super(townyPlugin.getName());
    this.towny = townyPlugin;
    this.plugin = p3;
}