Initial commit
This commit is contained in:
18
src/com/redstoner/modules/CoreModule.java
Normal file
18
src/com/redstoner/modules/CoreModule.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.redstoner.modules;
|
||||
|
||||
import com.redstoner.annotations.Version;
|
||||
|
||||
/** This class shall be used for "CoreModules", which are acting on a lower level than modules and are also exempted from being disabled or reloaded on the go.</br>
|
||||
* Examples are the ModuleLoader and the Debugger.
|
||||
*
|
||||
* @author Pepich */
|
||||
@Version(major = 1, minor = 0, revision = 0, compatible = -1)
|
||||
public interface CoreModule extends Module
|
||||
{
|
||||
/** Core modules should always be enabled. */
|
||||
@Override
|
||||
public default boolean enabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
28
src/com/redstoner/modules/Module.java
Normal file
28
src/com/redstoner/modules/Module.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.redstoner.modules;
|
||||
|
||||
import com.redstoner.annotations.Version;
|
||||
|
||||
/** Interface for the Module class. Modules must always have an empty constructor to be invoked by the ModuleLoader.
|
||||
*
|
||||
* @author Pepich */
|
||||
@Version(major = 1, minor = 0, revision = 0, compatible = 1)
|
||||
public interface Module
|
||||
{
|
||||
/** Will be called when the module gets enabled. */
|
||||
public default void onEnable()
|
||||
{}
|
||||
|
||||
/** Will be called when the module gets disabled. */
|
||||
public default void onDisable()
|
||||
{}
|
||||
|
||||
/** Will be called to check if a module is enabled or not.
|
||||
*
|
||||
* @return The status of the module, true when enabled, false when not. */
|
||||
public boolean enabled();
|
||||
|
||||
/** Gets called on registration of the module.
|
||||
*
|
||||
* @return The String used for the CommandManager to register the commands. */
|
||||
public String getCommandString();
|
||||
}
|
||||
39
src/com/redstoner/modules/adminchat/Adminchat.java
Normal file
39
src/com/redstoner/modules/adminchat/Adminchat.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.redstoner.modules.adminchat;
|
||||
|
||||
import com.redstoner.annotations.AutoRegisterEvents;
|
||||
import com.redstoner.annotations.Version;
|
||||
import com.redstoner.modules.Module;
|
||||
|
||||
/** AdminChat module. Allows staff to chat to other staff using /ac \<message\> as well as a one char prefix or a toggle.
|
||||
*
|
||||
* @author Pepich */
|
||||
@AutoRegisterEvents
|
||||
@Version(major = 1, minor = 0, revision = 0, compatible = 1)
|
||||
public class Adminchat implements Module
|
||||
{
|
||||
private boolean enabled = false;
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
this.enabled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandString()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
72
src/com/redstoner/modules/chatgroups/Chatgroups.java
Normal file
72
src/com/redstoner/modules/chatgroups/Chatgroups.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.redstoner.modules.chatgroups;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import com.nemez.cmdmgr.Command;
|
||||
import com.redstoner.annotations.AutoRegisterEvents;
|
||||
import com.redstoner.annotations.Version;
|
||||
import com.redstoner.modules.Module;
|
||||
|
||||
/** The ChatGroups module. Allows people to have private sub-chats that can be accessed via a single char prefix or a toggle.
|
||||
*
|
||||
* @author Pepich */
|
||||
@AutoRegisterEvents
|
||||
@Version(major = 1, minor = 0, revision = 0, compatible = 1)
|
||||
public class Chatgroups implements Module, Listener
|
||||
{
|
||||
private boolean enabled = false;
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@Command(hook = "cgkey")
|
||||
public void cgKaeyCommand(String key)
|
||||
{}
|
||||
|
||||
@Command(hook = "cgtoggle")
|
||||
public void cgToggleCommand()
|
||||
{}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
if (event.getMessage().startsWith(":"))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
sendToGroup(getGroup(event.getPlayer().getUniqueId()), event.getMessage().replaceFirst(":", ""));
|
||||
}
|
||||
}
|
||||
|
||||
public static String getGroup(UUID player)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
private void sendToGroup(String group, String message)
|
||||
{}
|
||||
}
|
||||
Reference in New Issue
Block a user