mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-23 02:25:26 +01:00
Possible bug fix.
This commit is contained in:
parent
310797d02a
commit
b9f4edca03
@ -46,7 +46,6 @@ public class SignListener implements Listener {
|
||||
|
||||
@EventHandler (priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onSignChange(SignChangeEvent event) {
|
||||
|
||||
if (event.getLine(0).equalsIgnoreCase("[menu]") && event.getPlayer().hasPermission(Permissions.SIGN_CREATE)) {
|
||||
|
||||
if (event.getLine(1).isEmpty()) {
|
||||
@ -67,6 +66,14 @@ public class SignListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler (priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onSignChangeMonitor(SignChangeEvent event) {
|
||||
// Prevent players with permissions for creating colored signs from creating menu signs.
|
||||
if (event.getLine(0).equalsIgnoreCase(ChatColor.BLUE + "[menu]") && !event.getPlayer().hasPermission(Permissions.SIGN_CREATE)) {
|
||||
event.setLine(0, ChatColor.stripColor(event.getLine(0)));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSign(Material material) {
|
||||
return material == Material.WALL_SIGN || material == Material.SIGN_POST;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user