Compare commits

...

54 Commits

Author SHA1 Message Date
dependabot[bot] 443e34d531 Bump org.postgresql:postgresql from 42.7.3 to 42.7.4
Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.3 to 42.7.4.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.7.3...REL42.7.4)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-23 05:01:26 +00:00
Kobe ⑧ 9e7e90db6c Update pom.xml 2024-08-22 18:36:50 +08:00
HaHaWTH 007e01156b B53 release 2024-08-20 23:52:40 +08:00
Kobe ⑧ d2ec62ac7f Merge pull request #203 from HaHaWTH/dependabot/maven/org.apache.maven.plugins-maven-deploy-plugin-3.1.3
Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.2 to 3.1.3
2024-08-20 18:46:24 +08:00
Kobe ⑧ da32bdec94 Merge pull request #204 from HaHaWTH/dependabot/maven/org.apache.maven.plugins-maven-install-plugin-3.1.3
Bump org.apache.maven.plugins:maven-install-plugin from 3.1.2 to 3.1.3
2024-08-20 18:46:14 +08:00
Kobe ⑧ 7d58e90557 Merge pull request #202 from HaHaWTH/dependabot/maven/org.xerial-sqlite-jdbc-3.46.1.0
Bump org.xerial:sqlite-jdbc from 3.46.0.1 to 3.46.1.0
2024-08-20 18:45:54 +08:00
dependabot[bot] 08dabda7c7 Bump org.apache.maven.plugins:maven-install-plugin from 3.1.2 to 3.1.3
Bumps [org.apache.maven.plugins:maven-install-plugin](https://github.com/apache/maven-install-plugin) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/apache/maven-install-plugin/releases)
- [Commits](https://github.com/apache/maven-install-plugin/compare/maven-install-plugin-3.1.2...maven-install-plugin-3.1.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-install-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-20 04:34:00 +00:00
dependabot[bot] feea348ec3 Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.2 to 3.1.3
Bumps [org.apache.maven.plugins:maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/apache/maven-deploy-plugin/releases)
- [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.1.2...maven-deploy-plugin-3.1.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-deploy-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-20 04:32:17 +00:00
dependabot[bot] 67eb7dee0f Bump org.xerial:sqlite-jdbc from 3.46.0.1 to 3.46.1.0
Bumps [org.xerial:sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.46.0.1 to 3.46.1.0.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.46.0.1...3.46.1.0)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 04:42:25 +00:00
Kobe ⑧ 6fb1d2855e Merge pull request #196 from HaHaWTH/dependabot/maven/net.kyori-adventure-platform-bukkit-4.3.4
Bump net.kyori:adventure-platform-bukkit from 4.3.3 to 4.3.4
2024-08-16 19:40:48 +08:00
dependabot[bot] faa3d9320c Bump net.kyori:adventure-platform-bukkit from 4.3.3 to 4.3.4
Bumps [net.kyori:adventure-platform-bukkit](https://github.com/KyoriPowered/adventure-platform) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/KyoriPowered/adventure-platform/releases)
- [Commits](https://github.com/KyoriPowered/adventure-platform/compare/v4.3.3...v4.3.4)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-platform-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-13 05:06:28 +00:00
Kobe ⑧ 497cd543fd Merge pull request #194 from HaHaWTH/dependabot/maven/org.checkerframework-checker-qual-3.46.0
Bump org.checkerframework:checker-qual from 3.45.0 to 3.46.0
2024-08-02 12:38:37 +08:00
Kobe ⑧ 71d5205df0 Merge pull request #192 from HaHaWTH/dependabot/maven/org.xerial-sqlite-jdbc-3.46.0.1
Bump org.xerial:sqlite-jdbc from 3.46.0.0 to 3.46.0.1
2024-08-02 12:38:26 +08:00
dependabot[bot] bba90d93f1 Bump org.checkerframework:checker-qual from 3.45.0 to 3.46.0
Bumps [org.checkerframework:checker-qual](https://github.com/typetools/checker-framework) from 3.45.0 to 3.46.0.
- [Release notes](https://github.com/typetools/checker-framework/releases)
- [Changelog](https://github.com/typetools/checker-framework/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/typetools/checker-framework/compare/checker-framework-3.45.0...checker-framework-3.46.0)

---
updated-dependencies:
- dependency-name: org.checkerframework:checker-qual
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-02 04:33:38 +00:00
HaHaWTH ab40b1b82d fix papi NPE 2024-07-31 23:48:32 +08:00
HaHaWTH 22a6cefbdc Merge remote-tracking branch 'origin/master' 2024-07-31 13:54:34 +08:00
HaHaWTH 9ca3a24862 Temporarily fix inventory loss 2024-07-31 13:53:54 +08:00
dependabot[bot] 91f0dfa5c5 Bump org.xerial:sqlite-jdbc from 3.46.0.0 to 3.46.0.1
Bumps [org.xerial:sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.46.0.0 to 3.46.0.1.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.46.0.0...3.46.0.1)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-31 04:21:56 +00:00
Kobe ⑧ f0e935a5d8 Merge pull request #186 from luketeam5/patch-1
Better Regex e-mail
2024-07-23 09:39:45 +08:00
luketeam5 f0fae0fce0 Update RestrictionSettings.java 2024-07-23 03:34:10 +02:00
luketeam5 4c40ba36a6 Better regex 2024-07-23 00:07:34 +02:00
HaHaWTH bd7a25560f Added config to disable changepassword email verification 2024-07-23 03:52:01 +08:00
Kobe ⑧ e02659d850 Merge pull request #183 from HaHaWTH/dependabot/maven/net.kyori-adventure-platform-bukkit-4.3.3
Bump net.kyori:adventure-platform-bukkit from 4.3.2 to 4.3.3
2024-07-22 13:37:10 +08:00
Kobe ⑧ c95f96572c Merge pull request #182 from HaHaWTH/dependabot/maven/org.apache.maven.plugins-maven-javadoc-plugin-3.8.0
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.7.0 to 3.8.0
2024-07-22 13:36:52 +08:00
dependabot[bot] 1c1356a4d1 Bump net.kyori:adventure-platform-bukkit from 4.3.2 to 4.3.3
Bumps [net.kyori:adventure-platform-bukkit](https://github.com/KyoriPowered/adventure-platform) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/KyoriPowered/adventure-platform/releases)
- [Commits](https://github.com/KyoriPowered/adventure-platform/compare/v4.3.2...v4.3.3)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-platform-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 04:18:17 +00:00
dependabot[bot] f206deb8ed Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.7.0 to 3.8.0
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.7.0...maven-javadoc-plugin-3.8.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 04:17:53 +00:00
Kobe ⑧ 9bf6aae8e9 [ci skip] Update README.md 2024-07-17 02:07:28 +08:00
HaHaWTH 63bfc7a5c1 B52 release 2024-07-14 17:48:25 +08:00
HaHaWTH 731c6477a5 PlaceholderAPI hook 2024-07-14 16:24:04 +08:00
HaHaWTH e0bf35284c Update runtime test to 1.21 2024-07-13 04:08:55 +08:00
HaHaWTH 02ebb0b0ab hehe 2024-07-12 23:26:14 +08:00
HaHaWTH 92741daaa8 fix: #178 mail sending lags server 2024-07-11 15:10:40 +08:00
Kobe ⑧ 18ce05d07d Merge pull request #174 from HaHaWTH/dependabot/maven/org.checkerframework-checker-qual-3.45.0
Bump org.checkerframework:checker-qual from 3.40.0 to 3.45.0
2024-07-02 13:38:18 +08:00
dependabot[bot] 37e6e9feb6 Bump org.checkerframework:checker-qual from 3.40.0 to 3.45.0
Bumps [org.checkerframework:checker-qual](https://github.com/typetools/checker-framework) from 3.40.0 to 3.45.0.
- [Release notes](https://github.com/typetools/checker-framework/releases)
- [Changelog](https://github.com/typetools/checker-framework/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/typetools/checker-framework/compare/checker-framework-3.40.0...checker-framework-3.45.0)

---
updated-dependencies:
- dependency-name: org.checkerframework:checker-qual
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 05:07:13 +00:00
Kobe ⑧ 655c5ca42c Bump version to 5.7.0-Fork 2024-06-30 12:20:05 +08:00
Kobe ⑧ c99fc5c389 Update plugin.yml 2024-06-30 12:19:19 +08:00
Kobe ⑧ 9b0a4a003e Bump version to 5.7.0-FORK 2024-06-30 12:18:46 +08:00
HaHaWTH f25610c90b Fix workflow 2024-06-27 12:10:57 +08:00
HaHaWTH 7130d3989c Bump version number 2024-06-27 12:02:24 +08:00
HaHaWTH 900d2bd2e9 Merge remote-tracking branch 'origin/master' 2024-06-27 11:57:55 +08:00
HaHaWTH 7d255dfa30 Sync with upstream & Bump version number 2024-06-27 11:57:17 +08:00
DGun Otto 0cce930260 Merge pull request #172 from HaHaWTH/dependabot/maven/org.apache.maven.plugins-maven-jar-plugin-3.4.2
Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.1 to 3.4.2
2024-06-20 14:37:48 +08:00
DGun Otto 0671a54b20 Merge pull request #171 from HaHaWTH/dependabot/maven/org.apache.maven.plugins-maven-clean-plugin-3.4.0
Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.2 to 3.4.0
2024-06-20 14:37:37 +08:00
dependabot[bot] 4df4a1fa4b Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.1 to 3.4.2
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.1...maven-jar-plugin-3.4.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 04:48:58 +00:00
dependabot[bot] 5b52a0ff00 Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.2 to 3.4.0
Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.3.2 to 3.4.0.
- [Release notes](https://github.com/apache/maven-clean-plugin/releases)
- [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.3.2...maven-clean-plugin-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-clean-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 04:48:06 +00:00
HaHaWTH 5186d09116 Revert some changes 2024-06-18 16:17:03 +08:00
HaHaWTH a5b06bbd07 Merge remote-tracking branch 'origin/master' 2024-06-12 01:46:32 +08:00
HaHaWTH 9b74cb5a00 Fix Folia join commands 2024-06-12 01:45:57 +08:00
DGun Otto be97e7faa0 Update maven.yml 2024-06-11 21:43:35 +08:00
HaHaWTH 253822a056 Merge remote-tracking branch 'origin/master' 2024-06-11 07:28:59 +08:00
HaHaWTH 0fcc45039d Add openInventory method to API 2024-06-11 07:28:13 +08:00
DGun Otto 4700e2ae90 Merge pull request #169 from Dreeam-qwq/fix/i18n-opt
Remove locale data from locale map when player quit to save ram
2024-06-10 06:51:49 +08:00
Dreeam d9c89e1dc6 Remove locale data from locale map when player quit to save mem 2024-06-10 06:15:48 +08:00
DGun Otto b513fd37cb [ci skip] Update link 2024-06-06 03:20:54 +08:00
27 changed files with 248 additions and 69 deletions
+3 -1
View File
@@ -25,7 +25,7 @@ jobs:
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: Download name: Download
path: ./target/AuthMe-5.6.0-FORK-Universal.jar path: ./target/AuthMe-*-FORK-Universal.jar
runtime-test: runtime-test:
name: Plugin Runtime Test name: Plugin Runtime Test
needs: [Build] needs: [Build]
@@ -41,6 +41,8 @@ jobs:
javaVersion: '17' javaVersion: '17'
- mcVersion: '1.20.4' - mcVersion: '1.20.4'
javaVersion: '21' javaVersion: '21'
- mcVersion: '1.21'
javaVersion: '21'
steps: steps:
- uses: HaHaWTH/minecraft-plugin-runtime-test@paper - uses: HaHaWTH/minecraft-plugin-runtime-test@paper
with: with:
-2
View File
@@ -41,8 +41,6 @@
[Releases](https://github.com/HaHaWTH/AuthMeReReloaded/releases/latest) [Releases](https://github.com/HaHaWTH/AuthMeReReloaded/releases/latest)
[Actions(Dev builds, use at your own risk!)](https://github.com/HaHaWTH/AuthMeReReloaded/actions/workflows/maven.yml) [Actions(Dev builds, use at your own risk!)](https://github.com/HaHaWTH/AuthMeReReloaded/actions/workflows/maven.yml)
If you are using FRP(内网穿透) for your server, this plugin may help [HAProxy-Detector](https://github.com/HaHaWTH/HAProxy-Detector)
**Pull Requests and suggestions are welcome!** **Pull Requests and suggestions are welcome!**
## License ## License
+25 -11
View File
@@ -6,7 +6,7 @@
<groupId>fr.xephi</groupId> <groupId>fr.xephi</groupId>
<artifactId>authme</artifactId> <artifactId>authme</artifactId>
<version>5.6.0-FORK</version> <version>5.7.0-FORK</version>
<name>AuthMeReReloaded</name> <name>AuthMeReReloaded</name>
<description>Fork of the first authentication plugin for the Bukkit API!</description> <description>Fork of the first authentication plugin for the Bukkit API!</description>
@@ -111,7 +111,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.7.0</version> <version>3.8.0</version>
<configuration> <configuration>
<failOnError>false</failOnError> <failOnError>false</failOnError>
<failOnWarnings>false</failOnWarnings> <failOnWarnings>false</failOnWarnings>
@@ -151,7 +151,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version> <version>3.4.0</version>
</plugin> </plugin>
<!-- Include resource files --> <!-- Include resource files -->
<plugin> <plugin>
@@ -199,7 +199,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version> <version>3.4.2</version>
<configuration> <configuration>
<archive> <archive>
<manifestEntries> <manifestEntries>
@@ -497,13 +497,13 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId> <artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version> <version>3.1.3</version>
</plugin> </plugin>
<!-- Deploy the jars as artifacts into the remote repository --> <!-- Deploy the jars as artifacts into the remote repository -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version> <version>3.1.3</version>
</plugin> </plugin>
<!-- Handle documentation generation, required by other plugins --> <!-- Handle documentation generation, required by other plugins -->
<plugin> <plugin>
@@ -623,6 +623,12 @@
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url> <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository> </repository>
<!-- Placeholder API Repo -->
<repository>
<id>placeholderapi-repo</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<!-- Multiverse Repo --> <!-- Multiverse Repo -->
<repository> <repository>
<id>onarandombox-repo-releases</id> <id>onarandombox-repo-releases</id>
@@ -699,7 +705,7 @@
</dependency> </dependency>
<!-- MaxMind GEO IP with our modifications to use GSON in replacement of the big Jackson dependency --> <!-- MaxMind GEO IP with our modifications to use GSON in replacement of the big Jackson dependency -->
<!-- GSON is already included and therefore it reduces the file size in comparison to the original version --> <!-- GSON is already included, and therefore it reduces the file size in comparison to the original version -->
<dependency> <dependency>
<groupId>com.maxmind.db</groupId> <groupId>com.maxmind.db</groupId>
<artifactId>maxmind-db-gson</artifactId> <artifactId>maxmind-db-gson</artifactId>
@@ -895,7 +901,7 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId> <artifactId>adventure-platform-bukkit</artifactId>
<version>4.3.2</version> <version>4.3.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
@@ -1038,6 +1044,14 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- Placeholder API -->
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
<!-- EssentialsX plugin --> <!-- EssentialsX plugin -->
<dependency> <dependency>
<groupId>net.essentialsx</groupId> <groupId>net.essentialsx</groupId>
@@ -1114,7 +1128,7 @@
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<version>42.7.3</version> <version>42.7.4</version>
<optional>true</optional> <optional>true</optional>
<exclusions> <exclusions>
<exclusion> <exclusion>
@@ -1128,7 +1142,7 @@
<dependency> <dependency>
<groupId>org.checkerframework</groupId> <groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId> <artifactId>checker-qual</artifactId>
<version>3.40.0</version> <version>3.46.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -1144,7 +1158,7 @@
<dependency> <dependency>
<groupId>org.xerial</groupId> <groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId> <artifactId>sqlite-jdbc</artifactId>
<version>3.46.0.0</version> <version>3.46.1.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
+3 -3
View File
@@ -74,9 +74,9 @@ public class AuthMe extends JavaPlugin {
private static final int CLEANUP_INTERVAL = 5 * TICKS_PER_MINUTE; private static final int CLEANUP_INTERVAL = 5 * TICKS_PER_MINUTE;
// Version and build number values // Version and build number values
private static String pluginVersion = "5.6.0-Fork"; private static String pluginVersion = "5.7.0-Fork";
private static final String pluginBuild = "b"; private static final String pluginBuild = "b";
private static String pluginBuildNumber = "50"; private static String pluginBuildNumber = "53";
// Private instances // Private instances
private EmailService emailService; private EmailService emailService;
private CommandHandler commandHandler; private CommandHandler commandHandler;
@@ -416,7 +416,7 @@ public class AuthMe extends JavaPlugin {
if (updater.isUpdateAvailable()) { if (updater.isUpdateAvailable()) {
String message = "New version available! Latest:" + updater.getLatestVersion() + " Current:" + pluginBuild + pluginBuildNumber; String message = "New version available! Latest:" + updater.getLatestVersion() + " Current:" + pluginBuild + pluginBuildNumber;
logger.warning(message); logger.warning(message);
logger.warning("Download from here: https://github.com/HaHaWTH/AuthMeReReloaded/releases/latest"); logger.warning("Download from here: https://modrinth.com/plugin/authmerereloaded");
} else { } else {
logger.info("You are running the latest version."); logger.info("You are running the latest version.");
} }
@@ -15,6 +15,8 @@ import fr.xephi.authme.util.PlayerUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import javax.inject.Inject; import javax.inject.Inject;
import java.time.Instant; import java.time.Instant;
@@ -24,6 +26,8 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Optional; import java.util.Optional;
import static fr.xephi.authme.listener.PlayerListener.PENDING_INVENTORIES;
/** /**
* The current API of AuthMe. * The current API of AuthMe.
* *
@@ -32,6 +36,7 @@ import java.util.Optional;
* AuthMeApi authmeApi = AuthMeApi.getInstance(); * AuthMeApi authmeApi = AuthMeApi.getInstance();
* </code> * </code>
*/ */
@SuppressWarnings("unused")
public class AuthMeApi { public class AuthMeApi {
private static AuthMeApi singleton; private static AuthMeApi singleton;
@@ -256,6 +261,18 @@ public class AuthMeApi {
return dataSource.saveAuth(auth); return dataSource.saveAuth(auth);
} }
/**
* Open an inventory for the given player at any time.
*
* @param player The player to open the inventory for
* @param inventory The inventory to open
* @return The inventory view
*/
public InventoryView openInventory(Player player, Inventory inventory) {
PENDING_INVENTORIES.add(inventory);
return player.openInventory(inventory);
}
/** /**
* Force a player to login, i.e. the player is logged in without needing his password. * Force a player to login, i.e. the player is logged in without needing his password.
* *
@@ -8,6 +8,7 @@ import fr.xephi.authme.process.Management;
import fr.xephi.authme.service.CommonService; import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.ValidationService; import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.service.ValidationService.ValidationResult; import fr.xephi.authme.service.ValidationService.ValidationResult;
import fr.xephi.authme.settings.properties.SecuritySettings;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import javax.inject.Inject; import javax.inject.Inject;
@@ -42,11 +43,14 @@ public class ChangePasswordCommand extends PlayerCommand {
commonService.send(player, MessageKey.NOT_LOGGED_IN); commonService.send(player, MessageKey.NOT_LOGGED_IN);
return; return;
} }
// Check if the user has been verified or not
if (codeManager.isVerificationRequired(player)) { if (commonService.getProperty(SecuritySettings.CHANGE_PASSWORD_EMAIL_VERIFICATION_REQUIRED)) {
codeManager.codeExistOrGenerateNew(name); // Check if the user has been verified or not
commonService.send(player, MessageKey.VERIFICATION_CODE_REQUIRED); if (codeManager.isVerificationRequired(player)) {
return; codeManager.codeExistOrGenerateNew(name);
commonService.send(player, MessageKey.VERIFICATION_CODE_REQUIRED);
return;
}
} }
String oldPassword = arguments.get(0); String oldPassword = arguments.get(0);
@@ -22,6 +22,8 @@ import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static fr.xephi.authme.AuthMe.getScheduler;
public class VerificationCodeManager implements SettingsDependent, HasCleanup { public class VerificationCodeManager implements SettingsDependent, HasCleanup {
private final EmailService emailService; private final EmailService emailService;
@@ -133,17 +135,19 @@ public class VerificationCodeManager implements SettingsDependent, HasCleanup {
* @param name the name of the player to generate a code for * @param name the name of the player to generate a code for
*/ */
private void generateCode(String name) { private void generateCode(String name) {
DataSourceValue<String> emailResult = dataSource.getEmail(name); getScheduler().runTaskAsynchronously(() -> {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'年'MM'月'dd'日' HH:mm:ss"); DataSourceValue<String> emailResult = dataSource.getEmail(name);
Date date = new Date(System.currentTimeMillis()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'-'MM'-'dd'-' HH:mm:ss");
if (emailResult.rowExists()) { Date date = new Date(System.currentTimeMillis());
final String email = emailResult.getValue(); if (emailResult.rowExists()) {
if (!Utils.isEmailEmpty(email)) { final String email = emailResult.getValue();
String code = RandomStringUtils.generateNum(6); // 6 digits code if (!Utils.isEmailEmpty(email)) {
verificationCodes.put(name.toLowerCase(Locale.ROOT), code); String code = RandomStringUtils.generateNum(6); // 6 digits code
emailService.sendVerificationMail(name, email, code, dateFormat.format(date)); verificationCodes.put(name.toLowerCase(Locale.ROOT), code);
emailService.sendVerificationMail(name, email, code, dateFormat.format(date));
}
} }
} });
} }
/** /**
@@ -75,9 +75,7 @@ class ListenerService implements SettingsDependent {
* @param player the player to verify * @param player the player to verify
* @return true if the associated event should be canceled, false otherwise * @return true if the associated event should be canceled, false otherwise
*/ */
public boolean shouldCancelEvent(Player player) { public boolean shouldCancelEvent(Player player) {
return player != null && !checkAuth(player.getName()) && !PlayerUtils.isNpc(player); return player != null && !checkAuth(player.getName()) && !PlayerUtils.isNpc(player);
} }
@Override @Override
@@ -16,9 +16,11 @@ import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.SpawnLoader; import fr.xephi.authme.settings.SpawnLoader;
import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.HooksSettings;
import fr.xephi.authme.settings.properties.PluginSettings;
import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.settings.properties.RestrictionSettings;
import fr.xephi.authme.util.TeleportUtils; import fr.xephi.authme.util.TeleportUtils;
import fr.xephi.authme.util.message.I18NUtils;
import fr.xephi.authme.util.message.MiniMessageUtils; import fr.xephi.authme.util.message.MiniMessageUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
@@ -50,9 +52,12 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerShearEntityEvent; import org.bukkit.event.player.PlayerShearEntityEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.InventoryView;
import javax.inject.Inject; import javax.inject.Inject;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
@@ -93,6 +98,7 @@ public class PlayerListener implements Listener {
@Inject @Inject
private QuickCommandsProtectionManager quickCommandsProtectionManager; private QuickCommandsProtectionManager quickCommandsProtectionManager;
public static List<Inventory> PENDING_INVENTORIES = new ArrayList<>();
// Lowest priority to apply fast protection checks // Lowest priority to apply fast protection checks
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
@@ -248,6 +254,11 @@ public class PlayerListener implements Listener {
} }
} }
// Remove data from locale map when player quit
if (settings.getProperty(PluginSettings.I18N_MESSAGES)) {
I18NUtils.removeLocale(player.getUniqueId());
}
if (antiBotService.wasPlayerKicked(player.getName())) { if (antiBotService.wasPlayerKicked(player.getName())) {
return; return;
} }
@@ -489,6 +500,17 @@ public class PlayerListener implements Listener {
} }
} }
private boolean isInventoryOpenedByApi(Inventory inventory) {
if (inventory == null) {
return false;
}
if (PENDING_INVENTORIES.contains(inventory)) {
PENDING_INVENTORIES.remove(inventory);
return true;
} else {
return false;
}
}
@SuppressWarnings("all") @SuppressWarnings("all")
private boolean isInventoryWhitelisted(InventoryView inventory) { private boolean isInventoryWhitelisted(InventoryView inventory) {
if (inventory == null) { if (inventory == null) {
@@ -515,7 +537,8 @@ public class PlayerListener implements Listener {
public void onPlayerInventoryOpen(InventoryOpenEvent event) { public void onPlayerInventoryOpen(InventoryOpenEvent event) {
final HumanEntity player = event.getPlayer(); final HumanEntity player = event.getPlayer();
if (listenerService.shouldCancelEvent(player) if (listenerService.shouldCancelEvent(player)
&& !isInventoryWhitelisted(event.getView())) { && !isInventoryWhitelisted(event.getView())
&& !isInventoryOpenedByApi(event.getInventory())) {
event.setCancelled(true); event.setCancelled(true);
/* /*
@@ -53,6 +53,9 @@ public class ServerListener implements Listener {
} else if ("ProtocolLib".equalsIgnoreCase(pluginName)) { } else if ("ProtocolLib".equalsIgnoreCase(pluginName)) {
protocolLibService.disable(); protocolLibService.disable();
logger.warning("ProtocolLib has been disabled, unhooking packet adapters!"); logger.warning("ProtocolLib has been disabled, unhooking packet adapters!");
} else if ("PlaceholderAPI".equalsIgnoreCase(pluginName)) {
pluginHookService.unhookPlaceholderApi();
logger.info("PlaceholderAPI has been disabled: unhooking placeholders");
} }
} }
@@ -74,6 +77,8 @@ public class ServerListener implements Listener {
spawnLoader.loadCmiSpawn(); spawnLoader.loadCmiSpawn();
} else if ("ProtocolLib".equalsIgnoreCase(pluginName)) { } else if ("ProtocolLib".equalsIgnoreCase(pluginName)) {
protocolLibService.setup(); protocolLibService.setup();
} else if ("PlaceholderAPI".equalsIgnoreCase(pluginName)) {
pluginHookService.tryHookToPlaceholderApi();
} }
} }
} }
@@ -29,8 +29,6 @@ import fr.xephi.authme.util.PlayerUtils;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import javax.inject.Inject; import javax.inject.Inject;
import java.util.Locale; import java.util.Locale;
@@ -208,7 +206,7 @@ public class AsynchronousJoin implements AsynchronousProcess {
int blindTimeOut = (registrationTimeout <= 0) ? 99999 : registrationTimeout; int blindTimeOut = (registrationTimeout <= 0) ? 99999 : registrationTimeout;
// AuthMeReReloaded - Fix potion apply on Folia // AuthMeReReloaded - Fix potion apply on Folia
bukkitService.runTaskIfFolia(player,() -> player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindTimeOut, 2))); bukkitService.runTaskIfFolia(player, () -> player.addPotionEffect(bukkitService.createBlindnessEffect(blindTimeOut)));
} }
commandManager.runCommandsOnJoin(player); commandManager.runCommandsOnJoin(player);
}); });
@@ -14,8 +14,6 @@ import fr.xephi.authme.settings.commandconfig.CommandManager;
import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.settings.properties.RestrictionSettings;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import javax.inject.Inject; import javax.inject.Inject;
@@ -75,7 +73,7 @@ public class ProcessSyncPlayerLogout implements SynchronousProcess {
// Apply Blindness effect // Apply Blindness effect
if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) {
int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND; int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND;
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2)); player.addPotionEffect(bukkitService.createBlindnessEffect(timeout));
} }
// Set player's data to unauthenticated // Set player's data to unauthenticated
@@ -29,7 +29,7 @@ public class ProcessSyncPlayerQuit implements SynchronousProcess {
} else { } else {
limboService.restoreData(player); limboService.restoreData(player);
if (!UniversalScheduler.isFolia) { // AuthMeReReloaded - Fix #146 (Very stupid solution, but works) if (!UniversalScheduler.isFolia) { // AuthMeReReloaded - Fix #146 (Very stupid solution, but works)
player.saveData(); // #1238: Speed is sometimes not restored properly // player.saveData(); // #1238: Speed is sometimes not restored properly
} }
} }
player.leaveVehicle(); player.leaveVehicle();
@@ -23,8 +23,6 @@ import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.settings.properties.RestrictionSettings;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import javax.inject.Inject; import javax.inject.Inject;
@@ -150,7 +148,7 @@ public class AsynchronousUnregister implements AsynchronousProcess {
private void applyBlindEffect(Player player) { private void applyBlindEffect(Player player) {
if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) {
int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND; int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND;
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2)); bukkitService.runTaskIfFolia(player, () -> player.addPotionEffect(bukkitService.createBlindnessEffect(timeout)));
} }
} }
@@ -18,6 +18,8 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import javax.inject.Inject; import javax.inject.Inject;
import java.util.Collection; import java.util.Collection;
@@ -327,6 +329,16 @@ public class BukkitService implements SettingsDependent {
return event; return event;
} }
/**
* Creates a PotionEffect with blindness for the given duration in ticks.
*
* @param timeoutInTicks duration of the effect in ticks
* @return blindness potion effect
*/
public PotionEffect createBlindnessEffect(int timeoutInTicks) {
return new PotionEffect(PotionEffectType.BLINDNESS, timeoutInTicks, 2);
}
/** /**
* Gets the world with the given name. * Gets the world with the given name.
* *
@@ -380,7 +392,11 @@ public class BukkitService implements SettingsDependent {
* @param bytes the message * @param bytes the message
*/ */
public void sendVelocityMessage(Player player, byte[] bytes) { public void sendVelocityMessage(Player player, byte[] bytes) {
player.sendPluginMessage(authMe, "authmevelocity:main", bytes); if (player != null) {
player.sendPluginMessage(authMe, "authmevelocity:main", bytes);
} else {
Bukkit.getServer().sendPluginMessage(authMe, "authmevelocity:main", bytes);
}
} }
@@ -37,7 +37,7 @@ public class GeoIpService {
private volatile boolean downloading; private volatile boolean downloading;
@Inject @Inject
GeoIpService(@DataFolder File dataFolder){ GeoIpService(@DataFolder File dataFolder) {
this.dataFile = dataFolder.toPath().resolve(DATABASE_FILE); this.dataFile = dataFolder.toPath().resolve(DATABASE_FILE);
// Fires download of recent data or the initialization of the look up service // Fires download of recent data or the initialization of the look up service
@@ -6,6 +6,8 @@ import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.api.MVWorldManager;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.output.ConsoleLoggerFactory; import fr.xephi.authme.output.ConsoleLoggerFactory;
import fr.xephi.authme.service.hook.papi.AuthMeExpansion;
import me.clip.placeholderapi.PlaceholderAPIPlugin;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@@ -26,6 +28,8 @@ public class PluginHookService {
private Essentials essentials; private Essentials essentials;
private Plugin cmi; private Plugin cmi;
private MultiverseCore multiverse; private MultiverseCore multiverse;
private PlaceholderAPIPlugin placeholderApi;
private AuthMeExpansion authMeExpansion;
/** /**
* Constructor. * Constructor.
@@ -38,6 +42,7 @@ public class PluginHookService {
tryHookToEssentials(); tryHookToEssentials();
tryHookToCmi(); tryHookToCmi();
tryHookToMultiverse(); tryHookToMultiverse();
tryHookToPlaceholderApi();
} }
/** /**
@@ -133,6 +138,20 @@ public class PluginHookService {
} }
} }
/**
* Attempts to create a hook into PlaceholderAPI.
*/
public void tryHookToPlaceholderApi() {
try {
placeholderApi = getPlugin(pluginManager, "PlaceholderAPI", PlaceholderAPIPlugin.class);
authMeExpansion = new AuthMeExpansion();
authMeExpansion.register();
} catch (Exception | NoClassDefFoundError ignored) {
placeholderApi = null;
authMeExpansion = null;
}
}
/** /**
* Attempts to create a hook into CMI. * Attempts to create a hook into CMI.
*/ */
@@ -180,6 +199,16 @@ public class PluginHookService {
multiverse = null; multiverse = null;
} }
/**
* Unhooks from PlaceholderAPI.
*/
public void unhookPlaceholderApi() {
if (placeholderApi != null) {
authMeExpansion.unregister();
placeholderApi = null;
}
}
// ------ // ------
// Helpers // Helpers
// ------ // ------
@@ -144,7 +144,7 @@ public class TeleportationService implements Reloadable {
if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) { if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
Location location = buildLocationFromAuth(player, auth); Location location = buildLocationFromAuth(player, auth);
Location playerLoc = player.getLocation(); Location playerLoc = player.getLocation();
if (location.getX() == playerLoc.getX() && location.getY() == location.getY() && location.getZ() == playerLoc.getZ() if (location.getX() == playerLoc.getX() && location.getY() == playerLoc.getY() && location.getZ() == playerLoc.getZ()
&& location.getWorld() == playerLoc.getWorld()) return; && location.getWorld() == playerLoc.getWorld()) return;
logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName()); logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName());
teleportBackFromSpawn(player, location); teleportBackFromSpawn(player, location);
@@ -0,0 +1,72 @@
package fr.xephi.authme.service.hook.papi;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.api.v3.AuthMeApi;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.HooksSettings;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
/**
* AuthMe PlaceholderAPI expansion class.
* @author Kobe 8
*/
public class AuthMeExpansion extends PlaceholderExpansion {
private final Settings settings = AuthMe.settings;
@Override
public @NotNull String getIdentifier() {
return "authme";
}
@Override
public @NotNull String getAuthor() {
return "HaHaWTH";
}
@Override
public @NotNull String getVersion() {
return AuthMe.getPluginVersion();
}
@Override
public boolean persist() {
return true;
}
@Override
public String onRequest(OfflinePlayer player, @NotNull String params) {
if (!settings.getProperty(HooksSettings.PLACEHOLDER_API)) return null;
AuthMeApi authMeApi = AuthMeApi.getInstance();
if (authMeApi == null) return null;
if (params.equalsIgnoreCase("version")) {
return getVersion();
}
if (params.equalsIgnoreCase("is_registered")) {
if (player != null) {
Player onlinePlayer = player.getPlayer();
if (onlinePlayer != null) {
return String.valueOf(authMeApi.isRegistered(onlinePlayer.getName()));
}
}
}
if (params.equalsIgnoreCase("is_authenticated")) {
if (player != null) {
Player onlinePlayer = player.getPlayer();
if (onlinePlayer != null) {
return String.valueOf(authMeApi.isAuthenticated(onlinePlayer));
}
}
}
if (params.equalsIgnoreCase("last_login_time")) {
if (player != null) {
Player onlinePlayer = player.getPlayer();
if (onlinePlayer != null) {
return authMeApi.getLastLoginTime(onlinePlayer.getName()).toString();
}
}
}
return null;
}
}
@@ -129,9 +129,9 @@ public class CommandManager implements Reloadable {
if (predicate.test(cmd)) { if (predicate.test(cmd)) {
long delay = cmd.getDelay(); long delay = cmd.getDelay();
if (delay > 0) { if (delay > 0) {
bukkitService.scheduleSyncDelayedTask(() -> dispatchCommand(player, cmd), delay); bukkitService.runTaskLater(player, () -> dispatchCommand(player, cmd), delay);
} else { } else {
dispatchCommand(player, cmd); bukkitService.runTaskIfFolia(player, () -> dispatchCommand(player, cmd));
} }
} }
} }
@@ -15,6 +15,10 @@ public final class HooksSettings implements SettingsHolder {
public static final Property<Boolean> MULTIVERSE = public static final Property<Boolean> MULTIVERSE =
newProperty("Hooks.multiverse", true); newProperty("Hooks.multiverse", true);
@Comment("Do we need to hook with PlaceholderAPI for AuthMe placeholders?")
public static final Property<Boolean> PLACEHOLDER_API =
newProperty("Hooks.placeholderapi", true);
@Comment("Do we need to hook with BungeeCord?") @Comment("Do we need to hook with BungeeCord?")
public static final Property<Boolean> BUNGEECORD = public static final Property<Boolean> BUNGEECORD =
newProperty("Hooks.bungeecord", false); newProperty("Hooks.bungeecord", false);
@@ -21,7 +21,7 @@ public final class PluginSettings implements SettingsHolder {
@Comment({ @Comment({
"Send i18n messages to player based on their client settings, this option will override `settings.messagesLanguage`", "Send i18n messages to player based on their client settings, this option will override `settings.messagesLanguage`",
"(Requires Protocollib or Packetevents)", "(Requires ProtocolLib)",
"This will not affect language of AuthMe help command." "This will not affect language of AuthMe help command."
}) })
public static final Property<Boolean> I18N_MESSAGES = public static final Property<Boolean> I18N_MESSAGES =
@@ -173,7 +173,7 @@ public final class RestrictionSettings implements SettingsHolder {
@Comment("Regex syntax for allowed chars in email.") @Comment("Regex syntax for allowed chars in email.")
public static final Property<String> ALLOWED_EMAIL_REGEX = public static final Property<String> ALLOWED_EMAIL_REGEX =
newProperty("settings.restrictions.allowedEmailCharacters", "^[A-Za-z0-9_.]{3,20}@(qq|outlook|163|gmail|icloud)\\.com$"); newProperty("settings.restrictions.allowedEmailCharacters", "^([a-zA-Z0-9_.+-]+)@([a-zA-Z0-9-]+)\\.([a-zA-Z]{2,})$");
@Comment("Force survival gamemode when player joins?") @Comment("Force survival gamemode when player joins?")
@@ -62,6 +62,11 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<Integer> HAVE_I_BEEN_PWNED_LIMIT = public static final Property<Integer> HAVE_I_BEEN_PWNED_LIMIT =
newProperty("Security.account.haveIBeenPwned.limit", 0); newProperty("Security.account.haveIBeenPwned.limit", 0);
@Comment({"Require email verification when changing password if email feature enabled.",
"Original behavior is true"})
public static final Property<Boolean> CHANGE_PASSWORD_EMAIL_VERIFICATION_REQUIRED =
newProperty("Security.account.emailVerification.required", true);
@Comment("Enable captcha when a player uses wrong password too many times") @Comment("Enable captcha when a player uses wrong password too many times")
public static final Property<Boolean> ENABLE_LOGIN_FAILURE_CAPTCHA = public static final Property<Boolean> ENABLE_LOGIN_FAILURE_CAPTCHA =
newProperty("Security.captcha.useCaptcha", false); newProperty("Security.captcha.useCaptcha", false);
@@ -60,6 +60,10 @@ public class I18NUtils {
PLAYER_LOCALE.put(uuid, locale); PLAYER_LOCALE.put(uuid, locale);
} }
public static void removeLocale(UUID uuid) {
PLAYER_LOCALE.remove(uuid);
}
/** /**
* Returns the AuthMe messages file language code, by given locale and settings. * Returns the AuthMe messages file language code, by given locale and settings.
* Dreeam - Hard mapping, based on mc1.20.6, 5/29/2024 * Dreeam - Hard mapping, based on mc1.20.6, 5/29/2024
@@ -2,9 +2,7 @@ package fr.xephi.authme.util.message;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.md_5.bungee.api.chat.BaseComponent;
public class MiniMessageUtils { public class MiniMessageUtils {
private static final MiniMessage miniMessage = MiniMessage.miniMessage(); private static final MiniMessage miniMessage = MiniMessage.miniMessage();
@@ -19,18 +17,6 @@ public class MiniMessageUtils {
Component component = miniMessage.deserialize(message); Component component = miniMessage.deserialize(message);
return LegacyComponentSerializer.legacyAmpersand().serialize(component); return LegacyComponentSerializer.legacyAmpersand().serialize(component);
} }
/**
* Parse a MiniMessage string into a BaseComponent.
*
* @param message The message to parse.
* @return The parsed message.
*/
public static BaseComponent[] parseMiniMessageToBaseComponent(String message) {
Component component = miniMessage.deserialize(message);
return BungeeComponentSerializer.legacy().serialize(component);
}
private MiniMessageUtils() { private MiniMessageUtils() {
} }
} }
+5 -1
View File
@@ -1,10 +1,13 @@
# noinspection YAMLSchemaValidation
name: ${pluginDescription.name} name: ${pluginDescription.name}
# noinspection YAMLSchemaValidation
authors: [${pluginDescription.authors}] authors: [${pluginDescription.authors}]
website: https://github.com/HaHaWTH/AuthMeReReloaded/ website: https://github.com/HaHaWTH/AuthMeReReloaded/
description: A fork of AuthMeReloaded that contains bug fixes description: A fork of AuthMeReloaded that contains bug fixes
# noinspection YAMLSchemaValidation
main: ${pluginDescription.main} main: ${pluginDescription.main}
folia-supported: true folia-supported: true
version: 5.6.0-FORK-b50 version: 5.7.0-FORK-b53
api-version: 1.13 api-version: 1.13
softdepend: softdepend:
- Vault - Vault
@@ -17,6 +20,7 @@ softdepend:
- EssentialsSpawn - EssentialsSpawn
- ProtocolLib - ProtocolLib
- floodgate - floodgate
- PlaceholderAPI
commands: commands:
authme: authme:
description: AuthMe op commands description: AuthMe op commands