Fix interactions in the overworld
This commit is contained in:
parent
eb5d538657
commit
b04fc5d8a1
|
|
@ -3,6 +3,7 @@ package com.alttd.cometskyblock.listeners;
|
|||
import com.alttd.cometskyblock.CometSkyBlockPlugin;
|
||||
import com.alttd.cometskyblock.island.Island;
|
||||
import com.alttd.cometskyblock.island.IslandPlayer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -76,6 +77,9 @@ public class PlayerListener implements Listener {
|
|||
boolean canInteract(Cancellable event, Player player) {
|
||||
World world = player.getWorld();
|
||||
IslandPlayer islandPlayer = IslandPlayer.getIslandPlayer(player.getUniqueId());
|
||||
if (world.getUID().equals(Bukkit.getWorlds().get(0).getUID()))
|
||||
return false;
|
||||
|
||||
if (!world.getUID().equals(islandPlayer.islandUUID())) {
|
||||
return cancelEvent(event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user