bugfix for < 1.13 Server

Fixed a bug where you could not reload the plugin (/t2c-alias reload) when using a server below 1.13
This commit is contained in:
JaTiTV 2022-12-21 10:35:35 +01:00
parent f00ac77743
commit 2d49a7a4b7
2 changed files with 12 additions and 7 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>Alias</artifactId> <artifactId>Alias</artifactId>
<version>1.1.6</version> <version>1.1.7-DEV</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2C-Alias</name> <name>T2C-Alias</name>
@ -82,9 +82,9 @@
<version>3.0</version> <version>3.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.t2code.minecraft.1_19.r1</groupId> <groupId>net.t2code.minecraft.1_13.r1</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.19r1</version> <version>1.13r1</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -4,6 +4,7 @@ import net.t2code.alias.Spigot.Main;
import net.t2code.alias.Spigot.cmdManagement.RegisterCommands; import net.t2code.alias.Spigot.cmdManagement.RegisterCommands;
import net.t2code.alias.Util; import net.t2code.alias.Util;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend; import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandMap; import org.bukkit.command.CommandMap;
@ -27,9 +28,13 @@ public class AliasRegister {
// wrap(alias, commandMap); // wrap(alias, commandMap);
} }
if (!(T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12())) {
Main.getPlugin().getBukkitCommandWrap().sync(); Main.getPlugin().getBukkitCommandWrap().sync();
if (Bukkit.getOnlinePlayers().size() >= 1) if (Bukkit.getOnlinePlayers().size() >= 1)
for (Player player : Bukkit.getOnlinePlayers()) player.updateCommands(); for (Player player : Bukkit.getOnlinePlayers()) player.updateCommands();
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }