mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-26 17:31:38 +01:00
teleportation will now correctly reset fly/upgrades.
This commit is contained in:
parent
43a6373ce2
commit
efd4b9938e
@ -1,8 +1,22 @@
|
||||
package me.goodandevil.skyblock.listeners;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.api.event.player.PlayerIslandEnterEvent;
|
||||
import me.goodandevil.skyblock.api.event.player.PlayerIslandExitEvent;
|
||||
import me.goodandevil.skyblock.api.event.player.PlayerIslandSwitchEvent;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
import me.goodandevil.skyblock.island.IslandWorld;
|
||||
import me.goodandevil.skyblock.message.MessageManager;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerData;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerDataManager;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
import me.goodandevil.skyblock.utils.version.NMSUtil;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
import me.goodandevil.skyblock.visit.Visit;
|
||||
import me.goodandevil.skyblock.world.WorldManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@ -12,23 +26,8 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
import me.goodandevil.skyblock.SkyBlock;
|
||||
import me.goodandevil.skyblock.api.event.player.PlayerIslandEnterEvent;
|
||||
import me.goodandevil.skyblock.api.event.player.PlayerIslandExitEvent;
|
||||
import me.goodandevil.skyblock.api.event.player.PlayerIslandSwitchEvent;
|
||||
import me.goodandevil.skyblock.config.FileManager;
|
||||
import me.goodandevil.skyblock.config.FileManager.Config;
|
||||
import me.goodandevil.skyblock.island.Island;
|
||||
import me.goodandevil.skyblock.message.MessageManager;
|
||||
import me.goodandevil.skyblock.island.IslandManager;
|
||||
import me.goodandevil.skyblock.island.IslandWorld;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerData;
|
||||
import me.goodandevil.skyblock.playerdata.PlayerDataManager;
|
||||
import me.goodandevil.skyblock.sound.SoundManager;
|
||||
import me.goodandevil.skyblock.utils.version.NMSUtil;
|
||||
import me.goodandevil.skyblock.utils.version.Sounds;
|
||||
import me.goodandevil.skyblock.visit.Visit;
|
||||
import me.goodandevil.skyblock.world.WorldManager;
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Teleport implements Listener {
|
||||
|
||||
@ -85,6 +84,8 @@ public class Teleport implements Listener {
|
||||
Island island = islandManager.getIslandAtLocation(event.getTo());
|
||||
|
||||
if (island != null) {
|
||||
islandManager.giveUpgrades(player, island);
|
||||
islandManager.giveFly(player, island);
|
||||
if (!island.getOwnerUUID().equals(playerData.getOwner())) {
|
||||
if (!player.hasPermission("fabledskyblock.bypass") && !player.hasPermission("fabledskyblock.bypass.*")
|
||||
&& !player.hasPermission("fabledskyblock.*")) {
|
||||
|
Loading…
Reference in New Issue
Block a user