2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-09-27 19:08:02 +00:00
RedisBungee/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeCommandSender.java
Tux 8b1ea2f7df Major changes.
* Some events are now handled asynchronously.
 * There is now support for a connection limit.
 * Fixed build under JDK8.
 * Player count is now cached again. Hopefully this means an increase in performance.
2014-03-30 00:31:35 -04:00

84 lines
2.0 KiB
Java

/**
* Copyright © 2013 tuxed <write@imaginarycode.com>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
package com.imaginarycode.minecraft.redisbungee;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.BaseComponent;
import java.util.Collection;
import java.util.Collections;
/**
* This class is the CommandSender that RedisBungee uses to dispatch commands to BungeeCord.
* <p>
* It inherits all permissions of the console command sender. Sending messages and modifying permissions are no-ops.
*
* @author tuxed
* @since 0.2.3
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RedisBungeeCommandSender implements CommandSender {
static final RedisBungeeCommandSender instance = new RedisBungeeCommandSender();
@Override
public String getName() {
return "RedisBungee";
}
@Override
public void sendMessage(String s) {
// no-op
}
@Override
public void sendMessages(String... strings) {
// no-op
}
@Override
public void sendMessage(BaseComponent... baseComponents) {
// no-op
}
@Override
public void sendMessage(BaseComponent baseComponent) {
// no-op
}
@Override
public Collection<String> getGroups() {
return Collections.emptySet();
}
@Override
public void addGroups(String... strings) {
// no-op
}
@Override
public void removeGroups(String... strings) {
// no-op
}
@Override
public boolean hasPermission(String s) {
return true;
}
@Override
public void setPermission(String s, boolean b) {
// no-op
}
@Override
public Collection<String> getPermissions() {
return Collections.emptySet();
}
}