9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-30 20:39:21 +00:00

Fix /locate command override

This commit is contained in:
CocoTheOwner
2021-02-07 12:52:07 +01:00
parent 672f2d717d
commit 28430cc1c3
2 changed files with 16 additions and 5 deletions

View File

@@ -2,18 +2,26 @@ package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.IrisWorlds;
import com.volmit.iris.util.Command;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
public class CommandLocate extends MortarCommand
public class CommandLocate extends MortarCommand implements Listener
{
@Command
private CommandIrisStudioGoto got0;
@EventHandler
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) {
if (event.getMessage().contains("locate") && IrisWorlds.isIrisWorld(event.getPlayer().getWorld())){
MortarSender s = (MortarSender) event.getPlayer();
s.sendMessage("/locate command blocked in Iris worlds. Please use '/ir goto' instead.");
event.setCancelled(true);
}
}
public CommandLocate()
{