Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6cee92ef1 | |||
| 31123081c7 | |||
| b5b435d398 | |||
| 395f8f825f | |||
| c71bd9f3a8 | |||
| 3e971c3dfd | |||
| 3f372d9228 | |||
| d385093403 | |||
| f978b285ae | |||
| 1eeaa442db | |||
| 14cc0abdc5 | |||
| d5ce692933 | |||
| 56a7b90c99 | |||
| 9352e7f32e | |||
| 0fc2f61a42 | |||
| 25249125b1 | |||
| 9d6d325fa6 | |||
| 0d408ede47 |
+2
-1
@@ -21,9 +21,10 @@ hs_err_pid*
|
||||
|
||||
# Ignore IDEA directory
|
||||
.idea/*
|
||||
.idea/
|
||||
|
||||
|
||||
# Include the project's code style settings file
|
||||
!.idea/codeStyleSettings.xml
|
||||
|
||||
# File-based project format:
|
||||
*.ipr
|
||||
|
||||
@@ -17,4 +17,5 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
|
||||
11. Automatically purge bot data
|
||||
12. Folia compatibility [Here](https://github.com/HaHaWTH/AuthMeReReloaded/releases/download/b20/AuthMe-5.6.0-FORK-Folia.jar)
|
||||
13. Offhand Menu compatibility(Thats amazing)
|
||||
14. More......
|
||||
14. Automatically fix portal stuck issue
|
||||
15. More......
|
||||
|
||||
@@ -1070,7 +1070,7 @@
|
||||
<dependency>
|
||||
<groupId>org.checkerframework</groupId>
|
||||
<artifactId>checker-qual</artifactId>
|
||||
<version>3.32.0</version>
|
||||
<version>3.39.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import fr.xephi.authme.initialization.SettingsProvider;
|
||||
import fr.xephi.authme.initialization.TaskCloser;
|
||||
import fr.xephi.authme.listener.BlockListener;
|
||||
import fr.xephi.authme.listener.EntityListener;
|
||||
import fr.xephi.authme.listener.LoginLocationFixListener;
|
||||
import fr.xephi.authme.listener.PlayerListener;
|
||||
import fr.xephi.authme.listener.PlayerListener111;
|
||||
import fr.xephi.authme.listener.PlayerListener19;
|
||||
@@ -75,7 +76,7 @@ public class AuthMe extends JavaPlugin {
|
||||
// Version and build number values
|
||||
private static String pluginVersion = "5.6.0-Fork";
|
||||
private static final String pluginBuild = "b";
|
||||
private static String pluginBuildNumber = "25";
|
||||
private static String pluginBuildNumber = "26";
|
||||
protected final Boolean SHAEnabled = false;
|
||||
// Private instances
|
||||
private EmailService emailService;
|
||||
@@ -210,6 +211,9 @@ public class AuthMe extends JavaPlugin {
|
||||
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
|
||||
getServer().getPluginManager().registerEvents(new DoubleLoginFixListener((Plugin) this), this);
|
||||
}
|
||||
if (settings.getProperty(SecuritySettings.LOGIN_LOC_FIX)) {
|
||||
getServer().getPluginManager().registerEvents(new LoginLocationFixListener((Plugin) this), this);
|
||||
}
|
||||
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
|
||||
getServer().getPluginManager().registerEvents(new GuiCaptchaHandler((Plugin) this), this);
|
||||
logger.info("(Alpha4)GUICaptcha Feature is enabled successfully!");
|
||||
|
||||
@@ -17,9 +17,9 @@ public abstract class PlayerCommand implements ExecutableCommand {
|
||||
} else {
|
||||
String alternative = getAlternativeCommand();
|
||||
if (alternative != null) {
|
||||
sender.sendMessage("此命令仅限玩家使用!请使用 " + alternative + " .");
|
||||
sender.sendMessage("Player only! Please use " + alternative + " instead.");
|
||||
} else {
|
||||
sender.sendMessage("此命令只能被玩家执行.");
|
||||
sender.sendMessage("This command is only for players.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class GuiCaptchaHandler implements Listener {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (currentItem!=null && currentItem.getType().equals(Material.REDSTONE_BLOCK)){
|
||||
if (currentItem != null && currentItem.getType().equals(Material.REDSTONE_BLOCK)){
|
||||
event.setCancelled(true);
|
||||
closeReasonMap.put(player, "verified");
|
||||
player.closeInventory();
|
||||
@@ -206,10 +206,10 @@ public class GuiCaptchaHandler implements Listener {
|
||||
File serverFolder = Bukkit.getServer().getWorldContainer();
|
||||
String worldFolderName = AuthMe.settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
||||
// 构建playerdata文件夹路径
|
||||
File playerDataFolder = new File(serverFolder, File.separator+worldFolderName+File.separator+"playerdata");
|
||||
File playerDataFolder = new File(serverFolder, File.separator + worldFolderName + File.separator + "playerdata");
|
||||
|
||||
// 构建玩家数据文件路径
|
||||
File playerDataFile = new File(playerDataFolder, File.separator+playerUUID + ".dat");
|
||||
File playerDataFile = new File(playerDataFolder, File.separator + playerUUID + ".dat");
|
||||
|
||||
// 删除玩家数据文件
|
||||
if (playerDataFile.exists()) {
|
||||
@@ -221,9 +221,9 @@ public class GuiCaptchaHandler implements Listener {
|
||||
File serverFolder = Bukkit.getServer().getWorldContainer();
|
||||
String worldFolderName = AuthMe.settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
||||
// 构建stats文件夹路径
|
||||
File statsFolder = new File(serverFolder, File.separator+worldFolderName+File.separator+"stats");
|
||||
File statsFolder = new File(serverFolder, File.separator + worldFolderName + File.separator + "stats");
|
||||
// 构建玩家统计数据文件路径
|
||||
File statsFile = new File(statsFolder, File.separator+playerUUID + ".json");
|
||||
File statsFile = new File(statsFolder, File.separator + playerUUID + ".json");
|
||||
// 删除玩家统计数据文件
|
||||
|
||||
if (statsFile.exists()) {
|
||||
@@ -238,7 +238,7 @@ public class GuiCaptchaHandler implements Listener {
|
||||
UUID playerUUID = event.getPlayer().getUniqueId();
|
||||
if (!authmeApi.isRegistered(name)) {
|
||||
if(AuthMe.settings.getProperty(SecuritySettings.DELETE_UNVERIFIED_PLAYER_DATA) && !closeReasonMap.containsKey(player)){
|
||||
Bukkit.getScheduler().runTaskLater(this.plugin,() -> {
|
||||
Bukkit.getScheduler().runTaskLater(this.plugin , () -> {
|
||||
if(!player.isOnline()) {
|
||||
deletePlayerData(playerUUID);
|
||||
deletePlayerStats(playerUUID);
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package fr.xephi.authme.listener;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
import fr.xephi.authme.events.LoginEvent;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class LoginLocationFixListener implements Listener{
|
||||
private final Plugin plugin;
|
||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||
public LoginLocationFixListener(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
BlockFace[] faces = {BlockFace.WEST, BlockFace.EAST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.SOUTH_EAST, BlockFace.SOUTH_WEST, BlockFace.NORTH_EAST, BlockFace.NORTH_WEST};
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (authmeApi.isRegistered(player.getName())) {
|
||||
Material material = Material.matchMaterial("PORTAL");
|
||||
if (material == null) {
|
||||
material = Material.matchMaterial("PORTAL_BLOCK");
|
||||
} else {
|
||||
material = Material.matchMaterial("NETHER_PORTAL");
|
||||
}
|
||||
Location JoinLocation = player.getLocation().getBlock().getLocation().add(0.5, 0.1, 0.5);
|
||||
if (AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL)) {
|
||||
if (!JoinLocation.getBlock().getType().equals(material) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(material)) {
|
||||
return;
|
||||
}
|
||||
Block JoinBlock = JoinLocation.getBlock();
|
||||
boolean solved = false;
|
||||
for (BlockFace face : faces) {
|
||||
if (JoinBlock.getRelative(face).getType().equals(Material.AIR) && JoinBlock.getRelative(face).getRelative(BlockFace.UP).getType().equals(Material.AIR)) {
|
||||
player.teleport(JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5));
|
||||
solved = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!solved) {
|
||||
JoinBlock.getRelative(BlockFace.UP).breakNaturally();
|
||||
JoinBlock.breakNaturally();
|
||||
}
|
||||
player.sendMessage("§a你在登录时卡在了地狱门, 现已修正");
|
||||
} else if (AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND)) {
|
||||
Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType();
|
||||
World world = player.getWorld();
|
||||
int MaxHeight = world.getMaxHeight();
|
||||
int MinHeight = world.getMinHeight();
|
||||
if (!UpType.isOccluding() && !UpType.equals(Material.LAVA)) {
|
||||
return;
|
||||
}
|
||||
for (int i = MinHeight; i <= MaxHeight; i++) {
|
||||
JoinLocation.setY(i);
|
||||
Block JoinBlock = JoinLocation.getBlock();
|
||||
if ((JoinBlock.getRelative(BlockFace.DOWN).getType().isBlock())
|
||||
&& JoinBlock.getType().equals(Material.AIR)
|
||||
&& JoinBlock.getRelative(BlockFace.UP).getType().equals(Material.AIR)) {
|
||||
if (JoinBlock.getRelative(BlockFace.DOWN).getType().equals(Material.LAVA)) {
|
||||
JoinBlock.getRelative(BlockFace.DOWN).setType(Material.DIRT);
|
||||
}
|
||||
player.teleport(JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
||||
player.sendMessage("§a你被埋住了, 坐标已修正, 下次下线之前请小心!");
|
||||
break;
|
||||
}
|
||||
if (i == MaxHeight) {
|
||||
player.teleport(JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
||||
player.sendMessage("§a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,15 @@ public final class SecuritySettings implements SettingsHolder {
|
||||
@Comment("Which world's player data should be deleted?(Enter the world *FOLDER* name where your players first logged in)")
|
||||
public static final Property<String> DELETE_PLAYER_DATA_WORLD = newProperty("3rdPartyFeature.captcha.purgeWorldFolderName","world");
|
||||
|
||||
@Comment("Should we enable the new LoginLocationFix feature?")
|
||||
public static final Property<Boolean> LOGIN_LOC_FIX = newProperty("3rdPartyFeature.fixes.loginLocationFix.enabled", false);
|
||||
|
||||
@Comment("Should we fix the location when players logged in the portal?")
|
||||
public static final Property<Boolean> LOGIN_LOC_FIX_SUB_PORTAL = newProperty("3rdPartyFeature.fixes.loginLocationFix.fixPortalStuck", false);
|
||||
|
||||
@Comment("Should we fix the location when players logged underground?")
|
||||
public static final Property<Boolean> LOGIN_LOC_FIX_SUB_UNDERGROUND = newProperty("3rdPartyFeature.fixes.loginLocationFix.fixGroundStuck", false);
|
||||
|
||||
// @Comment({"Should we kick the players when they failed captcha too many times?",
|
||||
// "(Minimum value is 1)(Default: 3)"})
|
||||
// public static final Property<Integer> GUI_CAPTCHA_MAX_TRY = newProperty("3rdPartyFeature.captcha.maxTryTimes",3);
|
||||
|
||||
@@ -3,7 +3,7 @@ authors: [${pluginDescription.authors}]
|
||||
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
||||
description: A fork of AuthMeReloaded that contains bug fixes
|
||||
main: ${pluginDescription.main}
|
||||
version: 5.6.0-FORK-b25
|
||||
version: 5.6.0-FORK-b26
|
||||
api-version: 1.13
|
||||
softdepend:
|
||||
- Vault
|
||||
|
||||
Reference in New Issue
Block a user