Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #30

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/craftaro/skyblock/island/Island.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public Island(@Nonnull OfflinePlayer player) {

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"));

Expand Down Expand Up @@ -191,7 +191,7 @@ public Island(@Nonnull OfflinePlayer player) {

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);
Expand All @@ -203,13 +203,13 @@ public Island(@Nonnull OfflinePlayer player) {

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)));
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/craftaro/skyblock/island/IslandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1530,9 +1530,7 @@ public void updateFlightAtIsland(Island island) {
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) {
Expand Down Expand Up @@ -1562,7 +1560,7 @@ public void updateFlight(Player player) {

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));
Expand Down
Loading