Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b630df850f | ||
|
|
da99cad206 | ||
|
|
22027b5fdd | ||
|
|
7f00c4183f | ||
|
|
2bde2fd8ac | ||
|
|
48a48f0c07 | ||
|
|
a70d1d7268 | ||
|
|
5cc4167e4f | ||
|
|
b9e2514556 | ||
|
|
0b11781329 | ||
|
|
645d11ea54 | ||
|
|
3e87b9f44a | ||
|
|
a6dc4514f2 | ||
|
|
69ea9a1d43 | ||
|
|
1dfbbb543c | ||
|
|
092df678a8 | ||
|
|
5f165eed75 | ||
|
|
a988422302 | ||
|
|
e5f6e31af2 | ||
|
|
f4bd83e86a | ||
|
|
7713ee499d | ||
|
|
6fb2d93650 | ||
|
|
81db29f76f | ||
|
|
fd2018186c | ||
|
|
bb85a7c619 | ||
|
|
9e7e90db6c | ||
|
|
007e01156b | ||
|
|
d2ec62ac7f | ||
|
|
da32bdec94 | ||
|
|
7d58e90557 | ||
|
|
08dabda7c7 | ||
|
|
feea348ec3 | ||
|
|
67eb7dee0f | ||
|
|
6fb1d2855e | ||
|
|
faa3d9320c | ||
|
|
497cd543fd | ||
|
|
71d5205df0 | ||
|
|
bba90d93f1 | ||
|
|
ab40b1b82d | ||
|
|
22a6cefbdc | ||
|
|
9ca3a24862 | ||
|
|
91f0dfa5c5 | ||
|
|
f0e935a5d8 | ||
|
|
f0fae0fce0 | ||
|
|
4c40ba36a6 | ||
|
|
bd7a25560f | ||
|
|
e02659d850 | ||
|
|
c95f96572c | ||
|
|
1c1356a4d1 | ||
|
|
f206deb8ed | ||
|
|
9bf6aae8e9 |
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
|||||||
javaVersion: '17'
|
javaVersion: '17'
|
||||||
- mcVersion: '1.20.4'
|
- mcVersion: '1.20.4'
|
||||||
javaVersion: '21'
|
javaVersion: '21'
|
||||||
- mcVersion: '1.21'
|
- mcVersion: '1.21.1'
|
||||||
javaVersion: '21'
|
javaVersion: '21'
|
||||||
steps:
|
steps:
|
||||||
- uses: HaHaWTH/minecraft-plugin-runtime-test@paper
|
- uses: HaHaWTH/minecraft-plugin-runtime-test@paper
|
||||||
|
|||||||
19
README.md
19
README.md
@ -27,22 +27,19 @@
|
|||||||
10. Player login logic improvement to reduce lag
|
10. Player login logic improvement to reduce lag
|
||||||
11. Automatically purge bot data
|
11. Automatically purge bot data
|
||||||
12. **Folia support (in active testing)**
|
12. **Folia support (in active testing)**
|
||||||
13. Offhand Menu compatibility(Thats amazing)
|
13. **Velocity support (See [Velocity Support](./vc-support.md))**
|
||||||
14. **Velocity support (See [Velocity Support](./vc-support.md))**
|
14. Support Virtual Threads caching
|
||||||
15. Support Virtual Threads caching
|
15. Automatically fix portal stuck issue
|
||||||
16. Automatically fix portal stuck issue
|
16. Automatically login for Bedrock players(configurable)
|
||||||
17. Automatically login for Bedrock players(configurable)
|
17. Fix shulker box crash bug on legacy versions(MC 1.13-)
|
||||||
18. Fix shulker box crash bug on legacy versions(MC 1.13-)
|
18. **H2 database support**
|
||||||
19. **H2 database support**
|
19. **100% compatibility with original authme and extensions**
|
||||||
20. **100% compatibility with original authme and extensions**
|
20. More......
|
||||||
21. More......
|
|
||||||
|
|
||||||
**Download links:**
|
**Download links:**
|
||||||
[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
|
||||||
|
|||||||
43
pom.xml
43
pom.xml
@ -67,7 +67,7 @@
|
|||||||
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
||||||
|
|
||||||
<!-- Dependencies versions -->
|
<!-- Dependencies versions -->
|
||||||
<spigot.version>1.20.6-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.21.1-R0.1-SNAPSHOT</spigot.version>
|
||||||
|
|
||||||
<!-- Versioning properties -->
|
<!-- Versioning properties -->
|
||||||
<project.outputName>AuthMe</project.outputName>
|
<project.outputName>AuthMe</project.outputName>
|
||||||
@ -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.11.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<failOnError>false</failOnError>
|
<failOnError>false</failOnError>
|
||||||
<failOnWarnings>false</failOnWarnings>
|
<failOnWarnings>false</failOnWarnings>
|
||||||
@ -497,19 +497,19 @@
|
|||||||
<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>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
<version>3.12.1</version>
|
<version>3.21.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- Publish coveralls test coverage reports, not included in the build cycle by default -->
|
<!-- Publish coveralls test coverage reports, not included in the build cycle by default -->
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -631,8 +631,9 @@
|
|||||||
|
|
||||||
<!-- Multiverse Repo -->
|
<!-- Multiverse Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>onarandombox-repo-releases</id>
|
<id>multiverse-multiverse-releases</id>
|
||||||
<url>https://repo.onarandombox.com/content/repositories/multiverse/</url>
|
<name>Multiverse Repository</name>
|
||||||
|
<url>https://repo.onarandombox.com/multiverse-releases</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
@ -640,22 +641,6 @@
|
|||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<id>onarandombox-repo-snapshots</id>
|
|
||||||
<url>https://repo.onarandombox.com/content/repositories/multiverse-snapshots/</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- FoliaLib -->
|
|
||||||
<repository>
|
|
||||||
<id>devmart-other</id>
|
|
||||||
<url>https://nexuslite.gcnt.net/repos/other/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>opencollab-snapshot</id>
|
<id>opencollab-snapshot</id>
|
||||||
@ -901,14 +886,14 @@
|
|||||||
<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>
|
||||||
<artifactId>adventure-text-serializer-gson</artifactId>
|
<artifactId>adventure-text-serializer-gson</artifactId>
|
||||||
<version>4.17.0</version>
|
<version>4.17.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- LuckPerms plugin -->
|
<!-- LuckPerms plugin -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.luckperms</groupId>
|
<groupId>net.luckperms</groupId>
|
||||||
@ -984,8 +969,8 @@
|
|||||||
<!-- Multi World plugin, https://www.spigotmc.org/resources/multiverse-core.390/ -->
|
<!-- Multi World plugin, https://www.spigotmc.org/resources/multiverse-core.390/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.onarandombox.multiversecore</groupId>
|
<groupId>com.onarandombox.multiversecore</groupId>
|
||||||
<artifactId>Multiverse-Core</artifactId>
|
<artifactId>multiverse-core</artifactId>
|
||||||
<version>4.3.1</version>
|
<version>4.3.14</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
@ -1142,7 +1127,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.checkerframework</groupId>
|
<groupId>org.checkerframework</groupId>
|
||||||
<artifactId>checker-qual</artifactId>
|
<artifactId>checker-qual</artifactId>
|
||||||
<version>3.45.0</version>
|
<version>3.48.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -1158,7 +1143,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.47.1.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
// Version and build number values
|
// Version and build number values
|
||||||
private static String pluginVersion = "5.7.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 = "52";
|
private static String pluginBuildNumber = "53";
|
||||||
// Private instances
|
// Private instances
|
||||||
private EmailService emailService;
|
private EmailService emailService;
|
||||||
private CommandHandler commandHandler;
|
private CommandHandler commandHandler;
|
||||||
|
|||||||
@ -15,8 +15,6 @@ 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;
|
||||||
@ -26,8 +24,6 @@ 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.
|
||||||
*
|
*
|
||||||
@ -261,18 +257,6 @@ 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);
|
||||||
|
|||||||
@ -52,12 +52,9 @@ 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;
|
||||||
|
|
||||||
@ -98,8 +95,6 @@ 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)
|
||||||
public void onAsyncPlayerPreLoginEventLowest(AsyncPlayerPreLoginEvent event) {
|
public void onAsyncPlayerPreLoginEventLowest(AsyncPlayerPreLoginEvent event) {
|
||||||
@ -500,17 +495,6 @@ 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) {
|
||||||
@ -537,8 +521,7 @@ 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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -556,12 +539,4 @@ public class PlayerListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// @EventHandler(priority = EventPriority.LOWEST)
|
|
||||||
// public void onSwitchHand(PlayerSwapHandItemsEvent event) {
|
|
||||||
// Player player = event.getPlayer();
|
|
||||||
// if (!player.isSneaking() || !player.hasPermission("keybindings.use"))
|
|
||||||
// return;
|
|
||||||
// event.setCancelled(true);
|
|
||||||
// Bukkit.dispatchCommand(event.getPlayer(), "help");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
|
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityPickupItemEvent;
|
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -26,12 +22,4 @@ public class PlayerListenerHigherThan18 implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
|
||||||
public void onSwitchHand(PlayerSwapHandItemsEvent event) {
|
|
||||||
Player player = event.getPlayer();
|
|
||||||
if (player.isSneaking() && player.hasPermission("keybindings.use") && settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
Bukkit.dispatchCommand(event.getPlayer(), "help");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
*/
|
*/
|
||||||
public class AuthMeExpansion extends PlaceholderExpansion {
|
public class AuthMeExpansion extends PlaceholderExpansion {
|
||||||
private final Settings settings = AuthMe.settings;
|
private final Settings settings = AuthMe.settings;
|
||||||
private final AuthMeApi authMeApi = AuthMeApi.getInstance();
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull String getIdentifier() {
|
public @NotNull String getIdentifier() {
|
||||||
return "authme";
|
return "authme";
|
||||||
@ -39,6 +38,8 @@ public class AuthMeExpansion extends PlaceholderExpansion {
|
|||||||
@Override
|
@Override
|
||||||
public String onRequest(OfflinePlayer player, @NotNull String params) {
|
public String onRequest(OfflinePlayer player, @NotNull String params) {
|
||||||
if (!settings.getProperty(HooksSettings.PLACEHOLDER_API)) return null;
|
if (!settings.getProperty(HooksSettings.PLACEHOLDER_API)) return null;
|
||||||
|
AuthMeApi authMeApi = AuthMeApi.getInstance();
|
||||||
|
if (authMeApi == null) return null;
|
||||||
if (params.equalsIgnoreCase("version")) {
|
if (params.equalsIgnoreCase("version")) {
|
||||||
return getVersion();
|
return getVersion();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public final class HooksSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("Do we need to hook with PlaceholderAPI for AuthMe placeholders?")
|
@Comment("Do we need to hook with PlaceholderAPI for AuthMe placeholders?")
|
||||||
public static final Property<Boolean> PLACEHOLDER_API =
|
public static final Property<Boolean> PLACEHOLDER_API =
|
||||||
newProperty("Hooks.placeholderapi", true);
|
newProperty("Hooks.placeholderapi", false);
|
||||||
|
|
||||||
@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 =
|
||||||
|
|||||||
@ -11,13 +11,6 @@ import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseString
|
|||||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||||
|
|
||||||
public final class PluginSettings implements SettingsHolder {
|
public final class PluginSettings implements SettingsHolder {
|
||||||
@Comment({
|
|
||||||
"Should we execute /help command when unregistered players press Shift+F?",
|
|
||||||
"This keeps compatibility with some menu plugins",
|
|
||||||
"If you are using TrMenu, don't enable this because TrMenu already implemented this."
|
|
||||||
})
|
|
||||||
public static final Property<Boolean> MENU_UNREGISTER_COMPATIBILITY =
|
|
||||||
newProperty("3rdPartyFeature.compatibility.menuPlugins", false);
|
|
||||||
|
|
||||||
@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`",
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
package fr.xephi.authme.task;
|
package fr.xephi.authme.task;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Scanner;
|
|
||||||
|
|
||||||
public class Updater {
|
public class Updater {
|
||||||
private final String currentVersion;
|
private final String currentVersion;
|
||||||
@ -32,14 +35,16 @@ public class Updater {
|
|||||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
conn.setConnectTimeout(10000);
|
conn.setConnectTimeout(10000);
|
||||||
conn.setReadTimeout(10000);
|
conn.setReadTimeout(10000);
|
||||||
Scanner scanner = new Scanner(conn.getInputStream());
|
conn.setRequestMethod("GET");
|
||||||
String response = scanner.useDelimiter("\\Z").next();
|
conn.setRequestProperty("Accept", "application/vnd.github+json");
|
||||||
scanner.close();
|
try (InputStreamReader reader = new InputStreamReader(conn.getInputStream())) {
|
||||||
String latestVersion = response.substring(response.indexOf("tag_name") + 11);
|
JsonObject jsonObject = new JsonParser().parse(reader).getAsJsonObject();
|
||||||
latestVersion = latestVersion.substring(0, latestVersion.indexOf("\""));
|
String latest = jsonObject.get("tag_name").getAsString();
|
||||||
this.latestVersion = latestVersion;
|
latestVersion = latest;
|
||||||
isUpdateAvailable = !currentVersion.equals(latestVersion);
|
isUpdateAvailable = !currentVersion.equals(latest);
|
||||||
return isUpdateAvailable;
|
reader.close();
|
||||||
|
return isUpdateAvailable;
|
||||||
|
}
|
||||||
} catch (IOException ignored) {
|
} catch (IOException ignored) {
|
||||||
this.latestVersion = null;
|
this.latestVersion = null;
|
||||||
isUpdateAvailable = false;
|
isUpdateAvailable = false;
|
||||||
|
|||||||
@ -104,7 +104,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank"
|
<a href="1919810.com" target="_blank"
|
||||||
style="text-decoration: none; font-size: 16px">wdsj.in</a>
|
style="text-decoration: none; font-size: 16px">example.com</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank"
|
<a href="1919810.com" target="_blank"
|
||||||
style="text-decoration: none; font-size: 16px">wdsj.in</a>
|
style="text-decoration: none; font-size: 16px">example.com</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -7,7 +7,7 @@ description: A fork of AuthMeReloaded that contains bug fixes
|
|||||||
# noinspection YAMLSchemaValidation
|
# noinspection YAMLSchemaValidation
|
||||||
main: ${pluginDescription.main}
|
main: ${pluginDescription.main}
|
||||||
folia-supported: true
|
folia-supported: true
|
||||||
version: 5.7.0-FORK-b52
|
version: 5.7.0-FORK-b53
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend:
|
softdepend:
|
||||||
- Vault
|
- Vault
|
||||||
|
|||||||
@ -103,7 +103,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank"
|
<a href="1919810.com" target="_blank"
|
||||||
style="text-decoration: none; font-size: 16px">wdsj.in</a>
|
style="text-decoration: none; font-size: 16px">example.com</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -101,7 +101,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank"
|
<a href="1919810.com" target="_blank"
|
||||||
style="text-decoration: none; font-size: 16px">wdsj.in</a>
|
style="text-decoration: none; font-size: 16px">example.com</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -103,7 +103,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2024 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank"
|
<a href="1919810.com" target="_blank"
|
||||||
style="text-decoration: none; font-size: 16px">wdsj.in</a>
|
style="text-decoration: none; font-size: 16px">example.com</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user