Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 32b694cbb0 | |||
| 932368f2d6 | |||
| 7a33fc8928 | |||
| d048db44ba | |||
| 76b92bacd9 | |||
| dadae42992 | |||
| 1e9058a5cb | |||
| b307911896 | |||
| 11a1547242 | |||
| 17ee5dc97b | |||
| ac89630f5d | |||
| 94028484cf | |||
| 1b1fd77470 | |||
| 7a7b148a7d | |||
| e6cee92ef1 | |||
| 31123081c7 | |||
| b5b435d398 | |||
| 395f8f825f | |||
| c71bd9f3a8 | |||
| 3e971c3dfd | |||
| 3f372d9228 | |||
| d385093403 | |||
| f978b285ae | |||
| 1eeaa442db | |||
| 14cc0abdc5 | |||
| d5ce692933 | |||
| 56a7b90c99 | |||
| 9352e7f32e | |||
| 0fc2f61a42 | |||
| 25249125b1 | |||
| 9d6d325fa6 | |||
| 0d408ede47 | |||
| 36bc761c19 | |||
| 9c3f0b0142 | |||
| e6be595c16 | |||
| dd4739a822 | |||
| 39254506bf | |||
| 227d93d756 | |||
| d223f316d6 | |||
| b6ec553dcb | |||
| cc6a9c38bd |
+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
|
||||
|
||||
@@ -16,4 +16,6 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
|
||||
10. Player login logic improvement to reduce lag
|
||||
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. More......
|
||||
13. Offhand Menu compatibility(Thats amazing)
|
||||
14. Automatically fix portal stuck issue
|
||||
15. More......
|
||||
|
||||
@@ -608,6 +608,16 @@
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack</id>
|
||||
<url>https://jitpack.io/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@@ -1060,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>
|
||||
|
||||
|
||||
@@ -9,21 +9,17 @@ import fr.xephi.authme.initialization.DataFolder;
|
||||
import fr.xephi.authme.initialization.DataSourceProvider;
|
||||
import fr.xephi.authme.initialization.OnShutdownPlayerSaver;
|
||||
import fr.xephi.authme.initialization.OnStartupTasks;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
|
||||
import fr.xephi.authme.initialization.SettingsProvider;
|
||||
import fr.xephi.authme.initialization.TaskCloser;
|
||||
import fr.xephi.authme.listener.BlockListener;
|
||||
import fr.xephi.authme.listener.DoubleLoginFixListener;
|
||||
import fr.xephi.authme.listener.EntityListener;
|
||||
import fr.xephi.authme.listener.GuiCaptchaHandler;
|
||||
import fr.xephi.authme.listener.LoginLocationFixListener;
|
||||
import fr.xephi.authme.listener.PlayerListener;
|
||||
import fr.xephi.authme.listener.PlayerListener111;
|
||||
import fr.xephi.authme.listener.PlayerListener19;
|
||||
import fr.xephi.authme.listener.PlayerListener19Spigot;
|
||||
import fr.xephi.authme.listener.DoubleLoginFixListener;
|
||||
import fr.xephi.authme.listener.GuiCaptchaHandler;
|
||||
import fr.xephi.authme.listener.PlayerListenerHigherThan18;
|
||||
import fr.xephi.authme.listener.ServerListener;
|
||||
import fr.xephi.authme.mail.EmailService;
|
||||
@@ -52,6 +48,9 @@ import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -75,7 +74,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 = "24";
|
||||
private static String pluginBuildNumber = "28";
|
||||
protected final Boolean SHAEnabled = false;
|
||||
// Private instances
|
||||
private EmailService emailService;
|
||||
@@ -210,6 +209,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!");
|
||||
@@ -325,13 +327,15 @@ public class AuthMe extends JavaPlugin {
|
||||
// Try to register 1.8+ player listeners
|
||||
if (isClassLoaded("org.bukkit.event.entity.EntityPickupItemEvent") && isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")){
|
||||
pluginManager.registerEvents(injector.getSingleton(PlayerListenerHigherThan18.class), this);
|
||||
}
|
||||
|
||||
// Try to register 1.9 player listeners
|
||||
if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||
} else if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||
pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
||||
}
|
||||
|
||||
// Try to register 1.9 player listeners(Moved to else-if)
|
||||
// if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||
// pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
||||
// }
|
||||
|
||||
// Try to register 1.9 spigot player listeners
|
||||
if (isClassLoaded("org.spigotmc.event.player.PlayerSpawnLocationEvent")) {
|
||||
pluginManager.registerEvents(injector.getSingleton(PlayerListener19Spigot.class), this);
|
||||
@@ -384,15 +388,16 @@ public class AuthMe extends JavaPlugin {
|
||||
infoLogMethod.accept("AuthMe " + this.getDescription().getVersion() + " is unloaded successfully!");
|
||||
ConsoleLogger.closeFileWriter();
|
||||
}
|
||||
|
||||
private static final String owner = "HaHaWTH";
|
||||
private static final String owner_gitee = "Shixuehan114514";
|
||||
private static final String repo = "AuthMeReReloaded";
|
||||
|
||||
private void checkForUpdates() {
|
||||
logger.info("Checking for updates...");
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
|
||||
try {
|
||||
// 从南通集线器获取最新版本号
|
||||
|
||||
URL url = new URL("https://api.github.com/repos/" + owner + "/" + repo + "/releases/latest");
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(10000); // 设置连接超时为10秒
|
||||
@@ -404,20 +409,37 @@ public class AuthMe extends JavaPlugin {
|
||||
// 处理JSON响应
|
||||
String latestVersion = response.substring(response.indexOf("tag_name") + 11);
|
||||
latestVersion = latestVersion.substring(0, latestVersion.indexOf("\""));
|
||||
if ((pluginBuild + pluginBuildNumber).equals(latestVersion)) {
|
||||
getLogger().log(Level.INFO,"You are running the latest version.");
|
||||
}
|
||||
if (!(pluginBuild + pluginBuildNumber).equals(latestVersion)) {
|
||||
// Display update message
|
||||
if (isUpdateAvailable(latestVersion)) {
|
||||
String message = "New version available! Latest:" + latestVersion + " Current:" + pluginBuild + pluginBuildNumber;
|
||||
getLogger().log(Level.INFO, message);
|
||||
getLogger().log(Level.INFO, "Download from here: github.com/HaHaWTH/AuthMeReReloaded/releases/latest");
|
||||
} else {
|
||||
getLogger().log(Level.INFO, "You are running the latest version.");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
getLogger().log(Level.WARNING, "Error occurred while checking updates from GitHub. Reason: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
private boolean isUpdateAvailable(String latestVersion) {
|
||||
// Extract the first character and the remaining digits from the version string
|
||||
char latestChar = latestVersion.charAt(0);
|
||||
int latestNumber = Integer.parseInt(latestVersion.substring(1));
|
||||
|
||||
char currentChar = pluginBuild.charAt(0);
|
||||
int currentNumber = Integer.parseInt(pluginBuildNumber);
|
||||
|
||||
// Compare the characters first
|
||||
if (latestChar > currentChar) {
|
||||
return true;
|
||||
} else if (latestChar < currentChar) {
|
||||
return false;
|
||||
} else {
|
||||
// If the characters are the same, compare the numbers
|
||||
return latestNumber > currentNumber;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void checkServerType() {
|
||||
if (isClassLoaded("com.destroystokyo.paper.PaperConfig")) {
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package fr.xephi.authme.listener;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.earth2me.essentials.libs.checkerframework.checker.nullness.qual.NonNull;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
@@ -23,26 +23,28 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static org.bukkit.Bukkit.getLogger;
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
public class GuiCaptchaHandler implements Listener{
|
||||
//define AuthMeApi
|
||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||
private final Plugin plugin;
|
||||
private PacketAdapter chatPacketListener;
|
||||
|
||||
|
||||
private PacketAdapter windowPacketListener;
|
||||
//define timesLeft
|
||||
public int timesLeft = 3;
|
||||
//Use ConcurrentHashMap to store player and their close reason
|
||||
/* We used many async tasks so there is concurrent**/
|
||||
protected static ConcurrentHashMap<Player, String> closeReasonMap = new ConcurrentHashMap<>();
|
||||
public static ConcurrentHashMap<Player, String> closeReasonMap = new ConcurrentHashMap<>();
|
||||
//define randomStringSet
|
||||
String randomSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#%&*()_+";
|
||||
String randomString = "";
|
||||
@@ -61,24 +63,16 @@ public class GuiCaptchaHandler implements Listener {
|
||||
public void onInventoryClick(InventoryClickEvent event) {
|
||||
if (event.getWhoClicked() instanceof Player) {
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
// 获取点击事件的容器
|
||||
ItemStack currentItem = event.getCurrentItem();
|
||||
if (!authmeApi.isRegistered(player.getName()) && !closeReasonMap.containsKey(player)) {
|
||||
if (AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getWhoClicked().getUniqueId()) && (getServer().getPluginManager().isPluginEnabled("floodgate") || getServer().getPluginManager().getPlugin("floodgate") != null)) {
|
||||
if (!closeReasonMap.containsKey(player)) {
|
||||
closeReasonMap.put(player,"verified");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/* Line 74 may throw NullPointerException, we can't solve it for now.*/
|
||||
if (Objects.requireNonNull(event.getCurrentItem()).getType().equals(Material.REDSTONE_BLOCK)) {
|
||||
if (currentItem != null && currentItem.getType().equals(Material.REDSTONE_BLOCK)){
|
||||
event.setCancelled(true);
|
||||
closeReasonMap.put(player, "verified");
|
||||
player.closeInventory();
|
||||
player.sendMessage("§a验证完成");
|
||||
} else {
|
||||
player.sendMessage("§c验证失败,你还有" + timesLeft + "§c次机会");
|
||||
timesLeft--;
|
||||
}
|
||||
//force to string
|
||||
}
|
||||
@@ -115,7 +109,7 @@ public class GuiCaptchaHandler implements Listener {
|
||||
randomString = sb.toString();
|
||||
Random random_blockpos = new Random();
|
||||
AtomicInteger random_num = new AtomicInteger(random_blockpos.nextInt(26));
|
||||
Inventory menu = Bukkit.createInventory(null, 27, randomString + "请验证你是真人");
|
||||
Inventory menu = Bukkit.createInventory(playerunreg, 27, randomString + "请验证你是真人");
|
||||
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
try {
|
||||
@@ -137,7 +131,7 @@ public class GuiCaptchaHandler implements Listener {
|
||||
long timeOut = AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT);
|
||||
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT)) {
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
Bukkit.getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
||||
getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
||||
AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT) + "). To prevent issues, we will let the GUI captcha follow the Login timeout seconds, please check and modify your config.");
|
||||
});
|
||||
timeOut = AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT);
|
||||
@@ -154,7 +148,7 @@ public class GuiCaptchaHandler implements Listener {
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
||||
windowPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||
@@ -163,31 +157,31 @@ public class GuiCaptchaHandler implements Listener {
|
||||
playerunreg.kickPlayer("§c请先完成人机验证!");
|
||||
});
|
||||
timesLeft = 3;
|
||||
return;
|
||||
} else {
|
||||
timesLeft--;
|
||||
playerunreg.sendMessage("§c请先完成验证!,你还有" + timesLeft + "次机会");
|
||||
|
||||
--timesLeft;
|
||||
if (timesLeft <= 0) {
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
playerunreg.kickPlayer("§c请先完成人机验证!");
|
||||
});
|
||||
timesLeft = 3;
|
||||
return;
|
||||
}
|
||||
playerunreg.sendMessage("§c请先完成验证!,你还有" + timesLeft + "次机会");
|
||||
event.setCancelled(true);
|
||||
random_num.set(random_blockpos.nextInt(26));
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
menu.clear();
|
||||
menu.setItem(random_num.get(), item);
|
||||
});
|
||||
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
playerunreg.openInventory(menu);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(windowPacketListener);
|
||||
});
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
||||
chatPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||
@@ -195,7 +189,8 @@ public class GuiCaptchaHandler implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(chatPacketListener);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -239,6 +234,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)) {
|
||||
closeReasonMap.remove(player);
|
||||
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
|
||||
if (!player.isOnline()) {
|
||||
deletePlayerData(playerUUID);
|
||||
@@ -247,6 +243,8 @@ public class GuiCaptchaHandler implements Listener {
|
||||
}, 100L);
|
||||
return;
|
||||
}
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(windowPacketListener);
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(chatPacketListener);
|
||||
closeReasonMap.remove(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package fr.xephi.authme.listener;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
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.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();
|
||||
Material material = Material.matchMaterial("PORTAL");
|
||||
if (material == null) {
|
||||
material = Material.matchMaterial("PORTAL_BLOCK");
|
||||
if(material == null){
|
||||
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你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,7 @@ public class Whirlpool extends UnsaltedMethod {
|
||||
if (bufferRem + sourceBits < 8) {
|
||||
// all remaining data fits on buffer[bufferPos], and there still
|
||||
// remains some space.
|
||||
bufferBits += sourceBits;
|
||||
bufferBits += (int) sourceBits;
|
||||
} else {
|
||||
// buffer[bufferPos] is full:
|
||||
bufferPos++;
|
||||
|
||||
@@ -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-b24
|
||||
version: 5.6.0-FORK-b28
|
||||
api-version: 1.13
|
||||
softdepend:
|
||||
- Vault
|
||||
|
||||
Reference in New Issue
Block a user