Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 168 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,171 @@

# Created by https://www.gitignore.io/api/java,linux,macos,windows,intellij

*.bat
/target/
/bin/
.settings/*
.classpath
.settings/**
.project
.idea
*.iml

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/sonarlint

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk


# End of https://www.gitignore.io/api/java,linux,macos,windows,intellij
26 changes: 0 additions & 26 deletions plugin.yml

This file was deleted.

28 changes: 17 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>vg.civcraft.mc.civchat2</groupId>
<artifactId>CivChat2</artifactId>
<packaging>jar</packaging>
<version>1.6.0</version>
<version>1.7.0</version>
<name>CivChat2</name>
<url>https://github.com/DevotedMC/CivChat2</url>

Expand All @@ -17,42 +18,47 @@
</properties>

<build>
<sourceDirectory>${basedir}/src</sourceDirectory>

<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>*.yml</include>
<include>License.txt</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>*.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.namelayer</groupId>
<artifactId>NameLayer</artifactId>
<version>2.11.0</version>
<version>2.12.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>vg.civcraft.mc.civmodcore</groupId>
<artifactId>CivModCore</artifactId>
<version>1.6.0</version>
<version>1.7.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
</dependency>
</dependencies>
Expand All @@ -62,8 +68,8 @@
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>devoted-repo</id>
<url>https://build.devotedmc.com/plugin/repository/everything/</url>
<id>civ-jenkins</id>
<url>http://build.devotedmc.com/plugin/repository/everything/</url>
</repository>
</repositories>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class ChatStrings {

public final static String localChatFormat = "<%1$s> %2$s";

public final static String chatPlayerIsOffline = "<i>That player is offline.";

public final static String chatNoOneToReplyTo = "<i>You have no one to reply to.";
Expand Down
99 changes: 99 additions & 0 deletions src/main/java/vg/civcraft/mc/civchat2/CivChat2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package vg.civcraft.mc.civchat2;

import java.util.LinkedList;

import vg.civcraft.mc.civchat2.database.CivChatDAO;
import vg.civcraft.mc.civchat2.listeners.CivChat2Listener;
import vg.civcraft.mc.civchat2.utility.CivChat2Config;
import vg.civcraft.mc.civchat2.utility.CivChat2FileLogger;
import vg.civcraft.mc.civchat2.utility.CivChat2Log;
import vg.civcraft.mc.civmodcore.ACivMod;
import vg.civcraft.mc.namelayer.GroupManager.PlayerType;
import vg.civcraft.mc.namelayer.permission.PermissionType;

/**
* @author jjj5311
*
*/
public class CivChat2 extends ACivMod {

private static CivChat2 instance;

private CivChat2Log log;
private CivChat2Config config;
private CivChat2Manager chatMan;
private CivChat2Listener chatListener;
private CivChat2FileLogger fileLog;
private CivChatDAO databaseManager;

@Override
public void onEnable() {
super.onEnable();
instance = this;
saveDefaultConfig();
reloadConfig();
config = new CivChat2Config(getConfig());
log = new CivChat2Log();
log.initializeLogger(instance);
fileLog = new CivChat2FileLogger();
databaseManager = new CivChatDAO();
chatMan = new CivChat2Manager(instance);
log.debug("Debug Enabled");
chatListener = new CivChat2Listener(chatMan);
registerNameLayerPermissions();
registerCivChatEvents();
}

@Override
public void onDisable() {
}

public CivChat2Manager getCivChat2Manager() {
return chatMan;
}

public boolean debugEnabled() {
return config.getDebug();
}

public CivChat2Log getCivChat2Log() {
return log;
}

private void registerCivChatEvents() {
getServer().getPluginManager().registerEvents(chatListener, this);
}

@SuppressWarnings("unchecked")
public void registerNameLayerPermissions() {

LinkedList<PlayerType> memberAndAbove = new LinkedList<PlayerType>();
memberAndAbove.add(PlayerType.MEMBERS);
memberAndAbove.add(PlayerType.MODS);
memberAndAbove.add(PlayerType.ADMINS);
memberAndAbove.add(PlayerType.OWNER);
PermissionType.registerPermission("READ_CHAT", (LinkedList<PlayerType>) memberAndAbove.clone());
PermissionType.registerPermission("WRITE_CHAT", (LinkedList<PlayerType>) memberAndAbove.clone());
}

public static CivChat2 getInstance() {
return instance;
}

public CivChat2Config getPluginConfig() {
return config;
}

public CivChat2FileLogger getCivChat2FileLogger() {
return fileLog;
}

public CivChatDAO getDatabaseManager() {
return this.databaseManager;
}

@Override
protected String getPluginName() {
return "CivChat2";
}
}
Loading