Skip to content

Commit

Permalink
feat: updater task
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Jul 21, 2024
1 parent 1f5d835 commit 7aef1af
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 128 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# GuizhanLib 插件
# GuizhanLibPlugin 鬼斩前置库插件

将 GuizhanLib 库整合到插件中,并提供自动更新站点选择功能。

## 下载

从构建站下载: [点击前往](https://builds.guizhanss.com/ybw0014/GuizhanLibPlugin/master)

![构建状态](https://builds.guizhanss.com/ybw0014/GuizhanLibPlugin/master/badge.svg)
![构建状态](https://builds.guizhanss.com/api/badge/ybw0014/GuizhanLibPlugin/master/latest)

## 如何使用

### 对于服主

将下载好的jar放入`plugins`目录,然后重启服务器即可。
将下载好的 jar 放入`plugins`目录,然后重启服务器即可。

### 对于开发者

将GuizhanLibPlugin添加为依赖项:
将 GuizhanLibPlugin 添加为依赖项:

[![Maven Central](https://img.shields.io/maven-central/v/net.guizhanss/GuizhanLibPlugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22net.guizhanss%22%20AND%20a:%22GuizhanLibPlugin%22)

Expand All @@ -29,21 +29,21 @@
</dependency>
```

并在`plugin.yml`中添加`GuizhanLibPlugin`为前置:
并在 `plugin.yml` 中添加 `GuizhanLibPlugin` 为前置:

```yaml
depend:
- GuizhanLibPlugin
```
你也可以添加`GuizhanLibPlugin`为软前置:
你也可以添加 `GuizhanLibPlugin` 为软前置:

```yaml
softdepend:
- GuizhanLibPlugin
```

并在插件的`onEnable`方法添加以下代码片段(尽量添加在前面):
并在插件的 `onEnable` 方法添加以下代码片段(尽量添加在前面):

```java
if (!getServer().getPluginManager().isPluginEnabled("GuizhanLibPlugin")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.guizhanss.guizhanlibplugin.config.ConfigManager;
import net.guizhanss.guizhanlibplugin.setup.MinecraftLanguageSetup;
import net.guizhanss.guizhanlibplugin.updater.GuizhanUpdater;
import net.guizhanss.guizhanlibplugin.updater.UniversalUpdater;
import net.guizhanss.guizhanlibplugin.updater.universal.v2.UniversalUpdater;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.DrilldownPie;
import org.bstats.charts.SimplePie;
Expand Down Expand Up @@ -58,6 +58,7 @@ public void enable() {

@Override
public void disable() {
// nothing to do
}

private void setupMinecraftLanguage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
import javax.annotation.Nonnull;

public final class ConfigManager {
private final GuizhanLibPlugin plugin;

@Getter
private final AddonConfig config;
@Getter
private final AddonConfig updaterConfig;

@Getter
private final boolean debugEnabled;
Expand All @@ -24,10 +20,7 @@ public final class ConfigManager {
private final String updaterLang;

public ConfigManager(@Nonnull GuizhanLibPlugin plugin) {
this.plugin = plugin;

config = new AddonConfig(plugin, "config.yml");
updaterConfig = new AddonConfig(plugin, "updater.yml");

debugEnabled = config.getBoolean("debug", false);
autoUpdateEnabled = config.getBoolean("auto-update", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* The universal updater wrapper.
*
* @author ybw0014
* @deprecated This class is deprecated, use {@link GuizhanUpdater} instead.
* @deprecated Use {@link GuizhanUpdater} instead.
*/
@Deprecated(since = "1.3.0")
@Deprecated(since = "1.3.0", forRemoval = true)
@UtilityClass
public final class GuizhanBuildsUpdaterWrapper {
/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.guizhanss.guizhanlibplugin.updater;
package net.guizhanss.guizhanlibplugin.updater.universal.v2;

import lombok.Getter;
import net.guizhanss.guizhanlib.updater.UpdaterConfig;
Expand Down
Loading

0 comments on commit 7aef1af

Please sign in to comment.