Plex 1.0.3

This commit is contained in:
Telesphoreo 2022-04-21 17:17:05 -05:00
parent c3a426d6db
commit 2cde4a430c
2 changed files with 8 additions and 4 deletions

View File

@ -58,7 +58,7 @@ dependencies {
} }
group = "dev.plex" group = "dev.plex"
version = "1.1-SNAPSHOT" version = "1.0.3"
description = "Plex" description = "Plex"
shadowJar { shadowJar {

View File

@ -32,6 +32,9 @@ import org.jetbrains.annotations.NotNull;
public class WorldListener extends PlexListener public class WorldListener extends PlexListener
{ {
private final List<String> EDIT_COMMANDS = Arrays.asList("bigtree", "ebigtree", "largetree", "elargetree",
"break", "ebreak", "antioch", "nuke", "editsign", "tree", "etree");
@EventHandler @EventHandler
public void onBlockPlace(BlockPlaceEvent e) public void onBlockPlace(BlockPlaceEvent e)
{ {
@ -76,10 +79,11 @@ public class WorldListener extends PlexListener
if (command != null) if (command != null)
{ {
// This does check for aliases // This does check for aliases
boolean isWeCommand = command instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand)command).getPlugin().equals(Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit")); boolean isWeCommand = command instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand)command).getPlugin().equals(Bukkit.getPluginManager().getPlugin("WorldEdit"));
if (isWeCommand) boolean isFaweCommand = command instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand)command).getPlugin().equals(Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit"));
if (isWeCommand || isFaweCommand || EDIT_COMMANDS.contains(message.toLowerCase()))
{ {
event.getPlayer().sendMessage(Component.text("You do not have permission to use WorldEdit in this world!").color(NamedTextColor.RED)); event.getPlayer().sendMessage(Component.text("You do not have permission to use that command in this world.").color(NamedTextColor.RED));
event.setCancelled(true); event.setCancelled(true);
} }
} }