Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69989fb99e | |||
| 8cf794e303 | |||
| de9e74d616 | |||
| e147a25076 | |||
| b25d874122 | |||
| b322032757 | |||
| d505601d33 | |||
| 8580d57a12 | |||
| b051f4feef | |||
| 96c886b93d | |||
| f1d6df9a17 | |||
| 6681075031 | |||
| 1aae25f510 |
@@ -206,7 +206,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.11.0</version>
|
<version>3.12.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>${java.source}</source>
|
<source>${java.source}</source>
|
||||||
<target>${java.target}</target>
|
<target>${java.target}</target>
|
||||||
@@ -346,6 +346,10 @@
|
|||||||
<pattern>com.google.gson</pattern>
|
<pattern>com.google.gson</pattern>
|
||||||
<shadedPattern>fr.xephi.authme.libs.com.google.gson</shadedPattern>
|
<shadedPattern>fr.xephi.authme.libs.com.google.gson</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
|
<!-- <relocation>-->
|
||||||
|
<!-- <pattern>com.cryptomorin.xseries</pattern>-->
|
||||||
|
<!-- <shadedPattern>fr.xephi.authme.libs.com.cryptomorin.xseries</shadedPattern>-->
|
||||||
|
<!-- </relocation>-->
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@@ -682,7 +686,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-email</artifactId>
|
<artifactId>commons-email</artifactId>
|
||||||
<version>1.6-SNAPSHOT</version>
|
<version>1.6.0</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -865,6 +869,14 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <!– XSeries –>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.github.cryptomorin</groupId>-->
|
||||||
|
<!-- <artifactId>XSeries</artifactId>-->
|
||||||
|
<!-- <version>9.8.0</version>-->
|
||||||
|
<!-- <scope>compile</scope>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<!-- zPermissions plugin -->
|
<!-- zPermissions plugin -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.tyrannyofheaven.bukkit</groupId>
|
<groupId>org.tyrannyofheaven.bukkit</groupId>
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
// Version and build number values
|
// Version and build number values
|
||||||
private static String pluginVersion = "5.6.0-Fork";
|
private static String pluginVersion = "5.6.0-Fork";
|
||||||
public static final String pluginBuild = "b";
|
private static final String pluginBuild = "b";
|
||||||
private static String pluginBuildNumber = "38";
|
private static String pluginBuildNumber = "39";
|
||||||
// Private instances
|
// Private instances
|
||||||
private EmailService emailService;
|
private EmailService emailService;
|
||||||
private CommandHandler commandHandler;
|
private CommandHandler commandHandler;
|
||||||
@@ -85,12 +85,22 @@ public class AuthMe extends JavaPlugin {
|
|||||||
private Injector injector;
|
private Injector injector;
|
||||||
private BackupService backupService;
|
private BackupService backupService;
|
||||||
public static ConsoleLogger logger;
|
public static ConsoleLogger logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public AuthMe() {
|
public AuthMe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the plugin's build
|
||||||
|
*
|
||||||
|
* @return The plugin's build
|
||||||
|
*/
|
||||||
|
public static String getPluginBuild() {
|
||||||
|
return pluginBuild;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the plugin's name.
|
* Get the plugin's name.
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@@ -70,12 +70,14 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
private int timesLeft = 3;
|
private int timesLeft = 3;
|
||||||
//Use ConcurrentHashMap to store player and their close reason
|
//Use ConcurrentHashMap to store player and their close reason
|
||||||
/* We used many async tasks so there is concurrent**/
|
/* We used many async tasks so there is concurrent**/
|
||||||
public static HashMap<Player, String> closeReasonMap = new HashMap<>();
|
public static ConcurrentHashMap<Player, String> closeReasonMap = new ConcurrentHashMap<>();
|
||||||
//define randomStringSet
|
//define randomStringSet
|
||||||
String randomSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#%&*()_+";
|
String randomSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#%&*()_+";
|
||||||
String randomString = "";
|
String randomString = "";
|
||||||
Random randomItemSet = new Random();
|
Random randomItemSet = new Random();
|
||||||
Random howManyRandom = new Random();
|
Random howManyRandom = new Random();
|
||||||
|
|
||||||
|
|
||||||
private boolean isPacketListenersActive = false;
|
private boolean isPacketListenersActive = false;
|
||||||
|
|
||||||
public GuiCaptchaHandler() {
|
public GuiCaptchaHandler() {
|
||||||
@@ -162,6 +164,7 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK);
|
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bukkitService.runTaskAsynchronously(() -> {
|
bukkitService.runTaskAsynchronously(() -> {
|
||||||
bukkitService.runTask(() -> {
|
bukkitService.runTask(() -> {
|
||||||
randomString = sb.toString();
|
randomString = sb.toString();
|
||||||
@@ -233,14 +236,12 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
timeOut = settings.getProperty(RestrictionSettings.TIMEOUT);
|
timeOut = settings.getProperty(RestrictionSettings.TIMEOUT);
|
||||||
}
|
}
|
||||||
long finalTimeOut = timeOut;
|
long finalTimeOut = timeOut;
|
||||||
bukkitService.runTask(() -> {
|
bukkitService.runTaskLater(() -> {
|
||||||
bukkitService.runTaskLater(() -> {
|
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||||
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_TIMEOUT));
|
||||||
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_TIMEOUT));
|
timesLeft = 3; // Reset the attempt counter
|
||||||
timesLeft = 3; // Reset the attempt counter
|
}
|
||||||
}
|
}, finalTimeOut * 20L);
|
||||||
}, finalTimeOut * 20L);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
|
||||||
public class LoginLocationFixListener implements Listener {
|
public class LoginLocationFixListener implements Listener {
|
||||||
@@ -33,6 +34,9 @@ public class LoginLocationFixListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Material materialPortal = Material.matchMaterial("PORTAL");
|
private static Material materialPortal = Material.matchMaterial("PORTAL");
|
||||||
|
|
||||||
|
private boolean isChecked = false;
|
||||||
|
private boolean isGetMinHeight = false;
|
||||||
private final boolean isSmartAsyncTeleport = AuthMe.settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT);
|
private final boolean isSmartAsyncTeleport = AuthMe.settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT);
|
||||||
private final boolean isFixPortalStuck = AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL);
|
private final boolean isFixPortalStuck = AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL);
|
||||||
private final boolean isFixGroundStuck = AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND);
|
private final boolean isFixGroundStuck = AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND);
|
||||||
@@ -47,10 +51,31 @@ public class LoginLocationFixListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getMinHeight(World world) {
|
||||||
|
//This keeps compatibility of 1.16.x and lower
|
||||||
|
try {
|
||||||
|
if (!isChecked) {
|
||||||
|
Method getMinHeightMethod = World.class.getMethod("getMinHeight");
|
||||||
|
getMinHeightMethod.setAccessible(true);
|
||||||
|
isChecked = true;
|
||||||
|
isGetMinHeight = true;
|
||||||
|
return world.getMinHeight();
|
||||||
|
} else if (isGetMinHeight) {
|
||||||
|
return world.getMinHeight();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
isChecked = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Location JoinLocation = player.getLocation().getBlock().getLocation().add(0.5, 0.1, 0.5);
|
Location JoinLocation = player.getLocation();
|
||||||
if (isFixPortalStuck) {
|
if (isFixPortalStuck) {
|
||||||
if (!JoinLocation.getBlock().getType().equals(materialPortal) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(materialPortal)) {
|
if (!JoinLocation.getBlock().getType().equals(materialPortal) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(materialPortal)) {
|
||||||
return;
|
return;
|
||||||
@@ -73,15 +98,15 @@ public class LoginLocationFixListener implements Listener {
|
|||||||
JoinBlock.breakNaturally();
|
JoinBlock.breakNaturally();
|
||||||
}
|
}
|
||||||
messages.send(player, MessageKey.LOCATION_FIX_PORTAL);
|
messages.send(player, MessageKey.LOCATION_FIX_PORTAL);
|
||||||
} else if (isFixGroundStuck) {
|
}
|
||||||
|
if (isFixGroundStuck) {
|
||||||
Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType();
|
Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType();
|
||||||
World world = player.getWorld();
|
World world = player.getWorld();
|
||||||
int MaxHeight = world.getMaxHeight();
|
int MaxHeight = world.getMaxHeight();
|
||||||
int MinHeight = world.getMinHeight();
|
|
||||||
if (!UpType.isOccluding() && !UpType.equals(Material.LAVA)) {
|
if (!UpType.isOccluding() && !UpType.equals(Material.LAVA)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (int i = MinHeight; i <= MaxHeight; i++) {
|
for (int i = getMinHeight(world); i <= MaxHeight; i++) {
|
||||||
JoinLocation.setY(i);
|
JoinLocation.setY(i);
|
||||||
Block JoinBlock = JoinLocation.getBlock();
|
Block JoinBlock = JoinLocation.getBlock();
|
||||||
if ((JoinBlock.getRelative(BlockFace.DOWN).getType().isBlock())
|
if ((JoinBlock.getRelative(BlockFace.DOWN).getType().isBlock())
|
||||||
@@ -108,5 +133,6 @@ public class LoginLocationFixListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -3,7 +3,7 @@ authors: [${pluginDescription.authors}]
|
|||||||
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
||||||
description: A fork of AuthMeReloaded that contains bug fixes
|
description: A fork of AuthMeReloaded that contains bug fixes
|
||||||
main: ${pluginDescription.main}
|
main: ${pluginDescription.main}
|
||||||
version: 5.6.0-FORK-b38
|
version: 5.6.0-FORK-b39
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend:
|
softdepend:
|
||||||
- Vault
|
- Vault
|
||||||
|
|||||||
Reference in New Issue
Block a user