mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-29 03:57:54 +01:00
Added checks on world change for mcgod
This commit is contained in:
parent
19ac0e6ba6
commit
3dbaf061ed
@ -34,6 +34,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||||
import org.bukkit.event.player.PlayerChatEvent;
|
import org.bukkit.event.player.PlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.event.player.PlayerFishEvent;
|
import org.bukkit.event.player.PlayerFishEvent;
|
||||||
@ -78,6 +79,22 @@ public class mcPlayerListener implements Listener
|
|||||||
plugin = instance;
|
plugin = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerWorldChangeEvent(PlayerChangedWorldEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
|
if(PP.getGodMode())
|
||||||
|
{
|
||||||
|
if(!mcPermissions.getInstance().mcgod(player))
|
||||||
|
{
|
||||||
|
PP.toggleGodMode();
|
||||||
|
player.sendMessage("[mcMMO] God Mode not permitted on this world (See Permissions)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onSheepUndressing(PlayerShearEntityEvent event)
|
public void onSheepUndressing(PlayerShearEntityEvent event)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user