Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
1.2.0 Light Operation
Browse files Browse the repository at this point in the history
- 🛠️ 轻量化插件体积,将依赖托付给 Taboolib 进行自动下载(我记得从 1M 左右变成了 79KB)
  • Loading branch information
ElaBosak233 committed Feb 5, 2021
1 parent b307c8c commit cef7b59
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 51 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Database: SQLite #SQLite, JSON, YAML (默认 SQLite,目前仅 SQLite 可以使
## 版本说明 Versions
```
v1.2.0 Light Operation
- 🛠️ 轻量化插件体积,将依赖托付给 Taboolib 进行自动下载(我记得从 1M 左右变成了 79KB)
```
```
v1.1.1 A Little Update
- 🔨 添加 EusAuthy 中 onDisable 方法
Expand All @@ -48,7 +53,8 @@ v1.0.0 Init EusAuthy
| 🛠️ 插件正式版本 | 🌳 Minecraft 版本 | 🔗 下载链接 |
| :----: | :----: | :----: |
| 1.1.1 | 1.13~1.16.4 | [EusAuthy-1.1.1.jar](https://github.com/ElaBosak233/EusAuthy/releases/download/1.1.1/EusAuthy-1.1.1.jar)
| 1.2.0 | 1.13~1.16.4 | [EusAuthy-1.2.0.jar](https://github.com/ElaBosak233/EusAuthy/releases/download/1.1.1/EusAuthy-1.2.0.jar) |
| 1.1.1 | 1.13~1.16.4 | [EusAuthy-1.1.1.jar](https://github.com/ElaBosak233/EusAuthy/releases/download/1.1.1/EusAuthy-1.1.1.jar) |
| 1.1.0 | 1.13~1.16.4 | [EusAuthy-1.1.0.jar](https://github.com/ElaBosak233/EusAuthy/releases/download/1.1.0/EusAuthy-1.1.0.jar) |
| 1.0.0 | 1.13~1.16.4 | [EusAuthy-1.0.0.jar](https://github.com/ElaBosak233/EusAuthy/releases/download/1.0.0/EusAuthy-1.0.0.jar) |
Expand Down
24 changes: 16 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
plugins {
id 'java'
id 'io.izzel.taboolib' version '1.2'
id 'io.izzel.taboolib' version '1.3'
}

group = 'cn.ac.ela.eusauthy'
version = '1.1.1'
group = 'in.e23.eusauthy'
version = '1.2.0'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

taboolib {
tabooLibVersion = '5.44'
loaderVersion = '2.8'
tabooLibVersion = '5.53'
loaderVersion = '2.10'
classifier = null
builtin = true
}

repositories {
mavenCentral()
maven {url 'https://jitpack.io'}
maven {url 'https://repo.codemc.org/repository/maven-public'}
maven {url 'https://maven.pkg.github.com/SydMontague/ImageMaps'}
}

dependencies {
//TabooLib
// compile 'ink.ptms.core:v11604:11604:all'
// compile 'ink.ptms.core:v11600:11600:all'
// compile 'ink.ptms.core:v11500:11500:all'
// compile 'ink.ptms.core:v11400:11400:all'
compile 'ink.ptms.core:v11300:11300:all'
// compile 'ink.ptms.core:v11200:11200:all'
compileOnly fileTree(dir: 'libs', includes: ['*.jar'])
//Dependencies
taboo 'de.taimos:totp:1.0'
taboo 'commons-codec:commons-codec:1.10'
taboo 'com.google.zxing:javase:3.2.1'
compile 'de.taimos:totp:1.0'
compile 'commons-codec:commons-codec:1.10'
compile 'com.google.zxing:javase:3.2.1'
compile 'com.google.zxing:core:3.2.1'
//bstats
taboo 'org.bstats:bstats-bukkit:1.8'
//Lombok
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/cn/ac/ela/eusauthy/sql/JSON.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.ac.ela.eusauthy;
package in.e23.eusauthy;

import org.bukkit.plugin.java.JavaPlugin;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package cn.ac.ela.eusauthy;
package in.e23.eusauthy;

import cn.ac.ela.eusauthy.cmd.Cmd2FA;
import cn.ac.ela.eusauthy.cmd.CmdAuthy;
import cn.ac.ela.eusauthy.lisenter.AuthyListener;
import cn.ac.ela.eusauthy.sql.DataInterface;
import cn.ac.ela.eusauthy.sql.SQLite;
import in.e23.eusauthy.cmd.Cmd2FA;
import in.e23.eusauthy.cmd.CmdAuthy;
import in.e23.eusauthy.lisenter.AuthyListener;
import in.e23.eusauthy.sql.DataInterface;
import in.e23.eusauthy.sql.SQLite;
import in.e23.eusauthy.utils.Authenticator;
import io.izzel.taboolib.loader.Plugin;
import io.izzel.taboolib.module.dependency.*;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand All @@ -14,6 +16,7 @@
import org.bukkit.scheduler.BukkitRunnable;

import java.io.File;
import java.net.ConnectException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
Expand All @@ -22,10 +25,14 @@
/**
* @author ElaBosak
*/
@Dependency(maven = "de.taimos:totp:1.0")
@Dependency(maven = "commons-codec:commons-codec:1.10")
@Dependency(maven = "com.google.zxing:javase:3.2.1")
@Dependency(maven = "com.google.zxing:core:3.2.1")
public class EusAuthy extends Plugin {

public static JavaPlugin plugin;
static DataInterface dataInterface;
public static DataInterface dataInterface;

// Player Stats
public static Map<Player, Boolean> isCreatingAuthy = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cn.ac.ela.eusauthy.cmd;
package in.e23.eusauthy.cmd;

import cn.ac.ela.eusauthy.EusAuthy;
import cn.ac.ela.eusauthy.utils.AuthyUtils;
import in.e23.eusauthy.EusAuthy;
import in.e23.eusauthy.utils.AuthyUtils;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.command.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cn.ac.ela.eusauthy.cmd;
package in.e23.eusauthy.cmd;

import cn.ac.ela.eusauthy.EusAuthy;
import cn.ac.ela.eusauthy.utils.Authenticator;
import cn.ac.ela.eusauthy.utils.AuthyUtils;
import in.e23.eusauthy.EusAuthy;
import in.e23.eusauthy.utils.Authenticator;
import in.e23.eusauthy.utils.AuthyUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
Expand Down Expand Up @@ -108,7 +108,7 @@ public void render(MapView map, MapCanvas canvas, Player player) {
canvas.drawImage(0,0,img);
}
});
MapMeta mapMeta = ((MapMeta)map.getItemMeta());
MapMeta mapMeta = (MapMeta) map.getItemMeta();
assert mapMeta != null;
mapMeta.setDisplayName("§6§lEusAuthy 二维码");
ArrayList<String> lore = new ArrayList<>();
Expand Down Expand Up @@ -185,7 +185,8 @@ public void render(MapView map, MapCanvas canvas, Player player) {
);
return true;
}
return false;
sender.sendMessage(ChatColor.RED+"未知命令! 请输入 /authy help 获取帮助");
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cn.ac.ela.eusauthy.lisenter;
package in.e23.eusauthy.lisenter;

import cn.ac.ela.eusauthy.EusAuthy;
import cn.ac.ela.eusauthy.object.PlayerData;
import cn.ac.ela.eusauthy.utils.AuthyUtils;
import in.e23.eusauthy.EusAuthy;
import in.e23.eusauthy.object.PlayerData;
import in.e23.eusauthy.utils.AuthyUtils;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.ac.ela.eusauthy.object;
package in.e23.eusauthy.object;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package cn.ac.ela.eusauthy.sql;
package in.e23.eusauthy.sql;

import cn.ac.ela.eusauthy.object.PlayerData;
import in.e23.eusauthy.object.PlayerData;

import java.io.IOException;
import java.util.UUID;

/**
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/in/e23/eusauthy/sql/JSON.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package in.e23.eusauthy.sql;

public class JSON {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cn.ac.ela.eusauthy.sql;
package in.e23.eusauthy.sql;

import cn.ac.ela.eusauthy.EusAuthy;
import cn.ac.ela.eusauthy.object.PlayerData;
import in.e23.eusauthy.EusAuthy;
import in.e23.eusauthy.object.PlayerData;
import lombok.Cleanup;
import org.sqlite.SQLiteConfig;
import org.sqlite.SQLiteDataSource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package cn.ac.ela.eusauthy.sql;
package in.e23.eusauthy.sql;

import cn.ac.ela.eusauthy.EusAuthy;
import cn.ac.ela.eusauthy.object.PlayerData;
import in.e23.eusauthy.object.PlayerData;

import java.io.File;
import java.util.UUID;

public class YAML implements DataInterface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.ac.ela.eusauthy.utils;
package in.e23.eusauthy.utils;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
Expand All @@ -8,6 +8,7 @@
import de.taimos.totp.TOTP;
import org.apache.commons.codec.binary.Base32;
import org.apache.commons.codec.binary.Hex;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.FileOutputStream;
Expand All @@ -21,6 +22,12 @@
*/
public class Authenticator {

JavaPlugin plugin;

public Authenticator(JavaPlugin plugin) {
this.plugin = plugin;
}

public static String generateSecretKey() {
SecureRandom random = new SecureRandom();
byte[] bytes = new byte[20];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package cn.ac.ela.eusauthy.utils;
package in.e23.eusauthy.utils;

import cn.ac.ela.eusauthy.EusAuthy;
import lombok.Cleanup;
import org.bukkit.ChatColor;
import in.e23.eusauthy.EusAuthy;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;

import java.io.File;
import java.util.UUID;
Expand Down

0 comments on commit cef7b59

Please sign in to comment.