Skip to content

Commit

Permalink
Plex 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Telesphoreo committed Apr 21, 2022
1 parent c3a426d commit 2cde4a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependencies {
}

group = "dev.plex"
version = "1.1-SNAPSHOT"
version = "1.0.3"
description = "Plex"

shadowJar {
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/dev/plex/listener/impl/WorldListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

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
public void onBlockPlace(BlockPlaceEvent e)
{
Expand Down Expand Up @@ -76,10 +79,11 @@ public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
if (command != null)
{
// This does check for aliases
boolean isWeCommand = command instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand)command).getPlugin().equals(Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit"));
if (isWeCommand)
boolean isWeCommand = command instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand)command).getPlugin().equals(Bukkit.getPluginManager().getPlugin("WorldEdit"));
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);
}
}
Expand Down

0 comments on commit 2cde4a4

Please sign in to comment.