Merge pull request #30 from TeamHRLive/development

Development
This commit is contained in:
Christian Koop 2024-03-02 16:42:14 +01:00 committed by GitHub
commit c69a5884e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 10 deletions

23
pom.xml
View File

@ -159,7 +159,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
@ -199,6 +199,27 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>3.16.29</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.107.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.eatthepath</groupId>
<artifactId>fast-uuid</artifactId>

View File

@ -113,7 +113,7 @@ public class Island {
this.level = new IslandLevel(getOwnerUUID(), this.plugin);
File configFile = new File(this.plugin.getDataFolder().toString() + "/island-data");
File configFile = new File(this.plugin.getDataFolder() + "/island-data");
Config config = fileManager.getConfig(new File(configFile, this.ownerUUID + ".yml"));
@ -191,7 +191,7 @@ public class Island {
Config settingsDataConfig = null;
File settingDataFile = new File(this.plugin.getDataFolder().toString() + "/setting-data", getOwnerUUID().toString() + ".yml");
File settingDataFile = new File(this.plugin.getDataFolder() + "/setting-data", getOwnerUUID().toString() + ".yml");
if (fileManager.isFileExist(settingDataFile)) {
settingsDataConfig = fileManager.getConfig(settingDataFile);
@ -203,13 +203,13 @@ public class Island {
for (BasicPermission permission : allPermissions) {
if (settingsDataConfig == null || settingsDataConfig.getFileConfiguration()
.getString("Settings." + roleList.getFriendlyName() + "." + permission.getName()) == null) {
.getString("Settings." + roleList.getFriendlyName().toUpperCase() + "." + permission.getName()) == null) {
permissions.add(
new IslandPermission(permission, this.plugin.getSettings()
.getBoolean("Settings." + roleList.getFriendlyName() + "." + permission.getName(), true)));
.getBoolean("Settings." + roleList.getFriendlyName().toUpperCase() + "." + permission.getName(), true)));
} else {
permissions.add(new IslandPermission(permission, settingsDataConfig.getFileConfiguration()
.getBoolean("Settings." + roleList.getFriendlyName() + "." + permission.getName(), true)));
.getBoolean("Settings." + roleList.getFriendlyName().toUpperCase() + "." + permission.getName(), true)));
}
}

View File

@ -1530,9 +1530,7 @@ public class IslandManager {
public void updateFlight(Player player) {
// The player can fly in other worlds if they are in creative or have another
// plugin's fly permission.
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR || player.hasPermission("essentials.fly") || player.hasPermission("cmi.command.fly")) {
return;
}
// Residence support
if (Bukkit.getServer().getPluginManager().getPlugin("Residence") != null) {
@ -1562,7 +1560,7 @@ public class IslandManager {
boolean hasGlobalFlyPermission = player.hasPermission("fabledskyblock.*") || player.hasPermission("fabledskyblock.fly.*");
boolean hasOwnIslandFlyPermission = player.hasPermission("fabledskyblock.fly") && island.getRole(player) != null && island.getRole(player) != IslandRole.VISITOR;
if (hasGlobalFlyPermission || hasOwnIslandFlyPermission) {
if (hasGlobalFlyPermission || hasOwnIslandFlyPermission || player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR || player.hasPermission("essentials.fly") || player.hasPermission("cmi.command.fly")) {
WorldManager worldManager = this.plugin.getWorldManager();
boolean canFlyInWorld = worldManager.isIslandWorld(player.getWorld());
Bukkit.getServer().getScheduler().runTask(this.plugin, () -> player.setAllowFlight(canFlyInWorld));