Compare commits

...

15 Commits

Author SHA1 Message Date
HaHaWTH 68ab92dd7a Merge remote-tracking branch 'origin/master' 2024-01-10 23:28:32 +08:00
HaHaWTH d9495ff839 B40 release 2024-01-10 23:28:08 +08:00
DGun Otto 0e01d8145f [ci skip] Update README.md 2024-01-08 21:55:31 +08:00
HaHaWTH ed9e379500 Merge remote-tracking branch 'origin/master' 2024-01-07 22:07:36 +08:00
HaHaWTH a9cb2d2490 Fix 2024-01-07 22:06:47 +08:00
DGun Otto 900937c033 Update updateChecker 2024-01-03 23:37:54 +08:00
DGun Otto 9585fc1bdb [ci skip] Update README.md 2024-01-02 21:17:55 +08:00
HaHaWTH d8d3e8544c Remove useless bannerColor 2023-12-31 21:25:42 +08:00
HaHaWTH a50e5fa802 Remove useless bannerColor 2023-12-31 17:40:43 +08:00
HaHaWTH c9363ca6e8 false 2023-12-31 17:34:57 +08:00
HaHaWTH 222bd879d1 Add warn 2023-12-31 17:34:42 +08:00
HaHaWTH 01f4a8f205 Revert config value to false 2023-12-31 17:20:43 +08:00
HaHaWTH be976b6738 Add AdvancedShulkerFix and optimize LoginLocationFix 2023-12-31 17:19:30 +08:00
HaHaWTH c89a818696 improve getMinHeight() 2023-12-31 14:10:28 +08:00
HaHaWTH 1c63eca0f7 improve getMinHeight() 2023-12-31 14:07:44 +08:00
9 changed files with 93 additions and 56 deletions
+5 -1
View File
@@ -5,6 +5,7 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
<p align="center"> <p align="center">
<img src="https://img.shields.io/github/languages/code-size/HaHaWTH/AuthMeReReloaded.svg" alt="Code size"/> <img src="https://img.shields.io/github/languages/code-size/HaHaWTH/AuthMeReReloaded.svg" alt="Code size"/>
<img src="https://img.shields.io/github/repo-size/HaHaWTH/AuthMeReReloaded.svg" alt="GitHub repo size"/> <img src="https://img.shields.io/github/repo-size/HaHaWTH/AuthMeReReloaded.svg" alt="GitHub repo size"/>
<img src="https://www.codefactor.io/repository/github/hahawth/authmerereloaded/badge" alt="CodeFactor" />
</p> </p>
**Detailed Changes:** **Detailed Changes:**
@@ -24,10 +25,13 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
13. Offhand Menu compatibility(Thats amazing) 13. Offhand Menu compatibility(Thats amazing)
14. Automatically fix portal stuck issue 14. Automatically fix portal stuck issue
15. Automatically login for Bedrock players(configurable) 15. Automatically login for Bedrock players(configurable)
16. More...... 16. Fix shulker box crash bug on legacy versions(MC 1.13-)
17. 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)
TODO: Implement HAProxy ip forward(Useful for Frp)
**Pull Requests and suggestions are welcome!** **Pull Requests and suggestions are welcome!**
+27 -8
View File
@@ -444,6 +444,14 @@
<pattern>com.google.protobuf</pattern> <pattern>com.google.protobuf</pattern>
<shadedPattern>fr.xephi.authme.libs.com.google.protobuf</shadedPattern> <shadedPattern>fr.xephi.authme.libs.com.google.protobuf</shadedPattern>
</relocation> </relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>fr.xephi.authme.libs.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.validator</pattern>
<shadedPattern>fr.xephi.authme.libs.org.apache.commons.validator</shadedPattern>
</relocation>
</relocations> </relocations>
<filters> <filters>
@@ -511,6 +519,15 @@
</build> </build>
<repositories> <repositories>
<repository>
<id>opencollab-snapshot-main</id>
<url>https://repo.opencollab.dev/main/</url>
</repository>
<repository>
<id>opencollab-maven-snapshots</id>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
</repository>
<!-- Apache snapshots repo --> <!-- Apache snapshots repo -->
<repository> <repository>
<id>apache-snapshots</id> <id>apache-snapshots</id>
@@ -629,10 +646,6 @@
<enabled>false</enabled> <enabled>false</enabled>
</snapshots> </snapshots>
</repository> </repository>
<repository>
<id>opencollab-snapshot-main</id>
<url>https://repo.opencollab.dev/main/</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
@@ -869,13 +882,19 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- &lt;!&ndash; XSeries &ndash;&gt;--> <!-- dependencies used by HAProxy feature -->
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>com.github.cryptomorin</groupId>--> <!-- <groupId>io.netty</groupId>-->
<!-- <artifactId>XSeries</artifactId>--> <!-- <artifactId>netty-codec-haproxy</artifactId>-->
<!-- <version>9.8.0</version>--> <!-- <version>4.1.104.Final</version>-->
<!-- <scope>compile</scope>--> <!-- <scope>compile</scope>-->
<!-- </dependency>--> <!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>commons-validator</groupId>-->
<!-- <artifactId>commons-validator</artifactId>-->
<!-- <version>1.8.0</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- zPermissions plugin --> <!-- zPermissions plugin -->
<dependency> <dependency>
+8 -12
View File
@@ -11,6 +11,7 @@ import fr.xephi.authme.initialization.OnShutdownPlayerSaver;
import fr.xephi.authme.initialization.OnStartupTasks; import fr.xephi.authme.initialization.OnStartupTasks;
import fr.xephi.authme.initialization.SettingsProvider; import fr.xephi.authme.initialization.SettingsProvider;
import fr.xephi.authme.initialization.TaskCloser; import fr.xephi.authme.initialization.TaskCloser;
import fr.xephi.authme.listener.AdvancedShulkerFixListener;
import fr.xephi.authme.listener.BedrockAutoLoginListener; import fr.xephi.authme.listener.BedrockAutoLoginListener;
import fr.xephi.authme.listener.BlockListener; import fr.xephi.authme.listener.BlockListener;
import fr.xephi.authme.listener.DoubleLoginFixListener; import fr.xephi.authme.listener.DoubleLoginFixListener;
@@ -74,7 +75,7 @@ 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";
private static final String pluginBuild = "b"; private static final String pluginBuild = "b";
private static String pluginBuildNumber = "39"; private static String pluginBuildNumber = "40";
// Private instances // Private instances
private EmailService emailService; private EmailService emailService;
private CommandHandler commandHandler; private CommandHandler commandHandler;
@@ -189,15 +190,6 @@ public class AuthMe extends JavaPlugin {
// Set up Metrics // Set up Metrics
OnStartupTasks.sendMetrics(this, settings); OnStartupTasks.sendMetrics(this, settings);
if (settings.getProperty(SecuritySettings.SHOW_STARTUP_BANNER)) { if (settings.getProperty(SecuritySettings.SHOW_STARTUP_BANNER)) {
String loadColorConfig = settings.getProperty(SecuritySettings.STARTUP_BANNER_COLOR);
if (loadColorConfig.startsWith("§") && !loadColorConfig.endsWith("§") && (loadColorConfig.length() % 2 == 0)) {
logger.info("\n" + loadColorConfig + " ___ __ __ __ ___ \n" +
loadColorConfig + " / | __ __/ /_/ /_ / |/ /__ \n" +
loadColorConfig + " / /| |/ / / / __/ __ \\/ /|_/ / _ \\\n" +
loadColorConfig + " / ___ / /_/ / /_/ / / / / / / __/\n" +
loadColorConfig + "/_/ |_\\__,_/\\__/_/ /_/_/ /_/\\___/ \n" +
loadColorConfig + " ");
} else {
logger.info("\n" + " ___ __ __ __ ___ \n" + logger.info("\n" + " ___ __ __ __ ___ \n" +
" / | __ __/ /_/ /_ / |/ /__ \n" + " / | __ __/ /_/ /_ / |/ /__ \n" +
" / /| |/ / / / __/ __ \\/ /|_/ / _ \\\n" + " / /| |/ / / / __/ __ \\/ /|_/ / _ \\\n" +
@@ -205,7 +197,6 @@ public class AuthMe extends JavaPlugin {
"/_/ |_\\__,_/\\__/_/ /_/_/ /_/\\___/ \n" + "/_/ |_\\__,_/\\__/_/ /_/_/ /_/\\___/ \n" +
" "); " ");
} }
}
// Successful message // Successful message
//detect server brand with classloader //detect server brand with classloader
checkServerType(); checkServerType();
@@ -359,6 +350,11 @@ public class AuthMe extends JavaPlugin {
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) { if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
pluginManager.registerEvents(injector.getSingleton(DoubleLoginFixListener.class), this); pluginManager.registerEvents(injector.getSingleton(DoubleLoginFixListener.class), this);
} }
if (settings.getProperty(SecuritySettings.ADVANCED_SHULKER_FIX) && !isClassLoaded("org.bukkit.event.player.PlayerCommandSendEvent")) {
pluginManager.registerEvents(injector.getSingleton(AdvancedShulkerFixListener.class), this);
} else if (settings.getProperty(SecuritySettings.ADVANCED_SHULKER_FIX) && isClassLoaded("org.bukkit.event.player.PlayerCommandSendEvent")) {
logger.warning("You are running an 1.13+ minecraft server, advancedShulkerFix won't enable.");
}
} }
/** /**
@@ -426,7 +422,7 @@ public class AuthMe extends JavaPlugin {
if (isUpdateAvailable(latestVersion)) { if (isUpdateAvailable(latestVersion)) {
String message = "New version available! Latest:" + latestVersion + " Current:" + pluginBuild + pluginBuildNumber; String message = "New version available! Latest:" + latestVersion + " Current:" + pluginBuild + pluginBuildNumber;
getLogger().log(Level.WARNING, message); getLogger().log(Level.WARNING, message);
getLogger().log(Level.WARNING, "Download from here: github.com/HaHaWTH/AuthMeReReloaded/releases/latest"); getLogger().log(Level.WARNING, "Download from here: https://github.com/HaHaWTH/AuthMeReReloaded/releases/latest");
} else { } else {
getLogger().log(Level.INFO, "You are running the latest version."); getLogger().log(Level.INFO, "You are running the latest version.");
} }
@@ -0,0 +1,26 @@
package fr.xephi.authme.listener;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockDispenseEvent;
//This fix is only for Minecraft 1.13-
public class AdvancedShulkerFixListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onDispenserActivate(BlockDispenseEvent event) {
Block block = event.getBlock();
if (block.getRelative(BlockFace.DOWN).getType().equals(Material.AIR) && block.getY() == 0) {
event.setCancelled(true);
return;
}
if (block.getRelative(BlockFace.UP).getType().equals(Material.AIR) && block.getY() == block.getWorld().getMaxHeight() - 1) {
event.setCancelled(true);
}
}
}
@@ -35,8 +35,7 @@ public class LoginLocationFixListener implements Listener {
private static Material materialPortal = Material.matchMaterial("PORTAL"); private static Material materialPortal = Material.matchMaterial("PORTAL");
private boolean isChecked = false; private static boolean isAvailable; // false: unchecked/method not available true: method is available
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);
@@ -49,26 +48,21 @@ public class LoginLocationFixListener implements Listener {
materialPortal = Material.matchMaterial("NETHER_PORTAL"); materialPortal = Material.matchMaterial("NETHER_PORTAL");
} }
} }
try {
Method getMinHeightMethod = World.class.getMethod("getMinHeight");
isAvailable = true;
} catch (NoSuchMethodException e) {
isAvailable = false;
}
} }
private int getMinHeight(World world) { private int getMinHeight(World world) {
//This keeps compatibility of 1.16.x and lower //This keeps compatibility of 1.16.x and lower
try { if (isAvailable) {
if (!isChecked) {
Method getMinHeightMethod = World.class.getMethod("getMinHeight");
getMinHeightMethod.setAccessible(true);
isChecked = true;
isGetMinHeight = true;
return world.getMinHeight();
} else if (isGetMinHeight) {
return world.getMinHeight(); return world.getMinHeight();
} else { } else {
return 0; return 0;
} }
} catch (NoSuchMethodException e) {
isChecked = true;
return 0;
}
} }
@@ -103,10 +97,11 @@ public class LoginLocationFixListener implements Listener {
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 = getMinHeight(world);
if (!UpType.isOccluding() && !UpType.equals(Material.LAVA)) { if (!UpType.isOccluding() && !UpType.equals(Material.LAVA)) {
return; return;
} }
for (int i = getMinHeight(world); i <= MaxHeight; i++) { for (int i = MinHeight; 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())
@@ -29,12 +29,8 @@ public class PlayerListenerHigherThan18 implements Listener {
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onSwitchHand(PlayerSwapHandItemsEvent event) { public void onSwitchHand(PlayerSwapHandItemsEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
if ((!player.isSneaking() || !player.hasPermission("keybindings.use")) && if (player.isSneaking() && player.hasPermission("keybindings.use") && settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
return;
}
event.setCancelled(true); event.setCancelled(true);
if (settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
Bukkit.dispatchCommand(event.getPlayer(), "help"); Bukkit.dispatchCommand(event.getPlayer(), "help");
} }
} }
@@ -14,7 +14,7 @@ public final class PluginSettings implements SettingsHolder {
"If you are using TrMenu, don't enable this because TrMenu already implemented this." "If you are using TrMenu, don't enable this because TrMenu already implemented this."
}) })
public static final Property<Boolean> MENU_UNREGISTER_COMPATIBILITY = public static final Property<Boolean> MENU_UNREGISTER_COMPATIBILITY =
newProperty("3rdPartyFeature.compatibility.menuPlugins", true); newProperty("3rdPartyFeature.compatibility.menuPlugins", false);
@Comment({ @Comment({
"Do you want to enable the session feature?", "Do you want to enable the session feature?",
@@ -35,6 +35,11 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<Boolean> ANTI_GHOST_PLAYERS = public static final Property<Boolean> ANTI_GHOST_PLAYERS =
newProperty("3rdPartyFeature.fixes.antiGhostPlayer", false); newProperty("3rdPartyFeature.fixes.antiGhostPlayer", false);
@Comment({"(MC1.13- only)",
"Should we fix the shulker crash bug with advanced method?"})
public static final Property<Boolean> ADVANCED_SHULKER_FIX =
newProperty("3rdPartyFeature.fixes.advancedShulkerFix", false);
@Comment({"Choose the best teleport method by server brand?", @Comment({"Choose the best teleport method by server brand?",
"(Enable this if you are using Paper)"}) "(Enable this if you are using Paper)"})
public static final Property<Boolean> SMART_ASYNC_TELEPORT = public static final Property<Boolean> SMART_ASYNC_TELEPORT =
@@ -95,10 +100,6 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<Boolean> SHOW_STARTUP_BANNER = public static final Property<Boolean> SHOW_STARTUP_BANNER =
newProperty("Plugin.banners.showBanners", true); newProperty("Plugin.banners.showBanners", true);
@Comment("Change the banner colors here (Default: §r)")
public static final Property<String> STARTUP_BANNER_COLOR =
newProperty("Plugin.banners.bannerColor", "§r");
@Comment("Max allowed tries before a captcha is required") @Comment("Max allowed tries before a captcha is required")
public static final Property<Integer> MAX_LOGIN_TRIES_BEFORE_CAPTCHA = public static final Property<Integer> MAX_LOGIN_TRIES_BEFORE_CAPTCHA =
newProperty("Security.captcha.maxLoginTry", 8); newProperty("Security.captcha.maxLoginTry", 8);
+1 -1
View File
@@ -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-b39 version: 5.6.0-FORK-b40
api-version: 1.13 api-version: 1.13
softdepend: softdepend:
- Vault - Vault