mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Gradle @broccolai
This commit is contained in:
1 parent
6f28851211
commit
f54a71a25b
34 files changed
+675
-469
No files matched your search
+14
-13
@@ -60,18 +60,19 @@ hs_err_pid*
|
|||||||
.idea/modules
|
.idea/modules
|
||||||
.idea/misc.xml
|
.idea/misc.xml
|
||||||
|
|
||||||
# Maven generated files
|
|
||||||
/target/
|
|
||||||
*/target/
|
|
||||||
pom.xml.tag
|
|
||||||
pom.xml.releaseBackup
|
|
||||||
pom.xml.versionsBackup
|
|
||||||
pom.xml.next
|
|
||||||
release.properties
|
|
||||||
dependency-reduced-pom.xml
|
|
||||||
buildNumber.properties
|
|
||||||
.mvn/timing.properties
|
|
||||||
.mvn/wrapper/maven-wrapper.jar
|
|
||||||
|
|
||||||
# Dolphin browser keeps recreating this
|
# Dolphin browser keeps recreating this
|
||||||
.directory
|
.directory
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.gradle
|
||||||
|
**/build/
|
||||||
|
!src/**/build/
|
||||||
|
|
||||||
|
# Ignore Gradle GUI config
|
||||||
|
gradle-app.setting
|
||||||
|
|
||||||
|
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||||
|
!gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Cache of project
|
||||||
|
.gradletasknamecache
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "me.bristermitten:pdm-gradle:0.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'me.bristermitten.pdm'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
pdm 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72' //This will be added to the dependencies.json
|
||||||
|
|
||||||
|
compileOnly 'org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT'
|
||||||
|
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
|
||||||
|
compileOnly 'com.gmail.nossr50.mcMMO:mcMMO:2.1.130'
|
||||||
|
|
||||||
|
providedCompile project(':SimpleChat')
|
||||||
|
}
|
||||||
|
|
||||||
|
jar.dependsOn project.tasks.getByName('pdm') // Always run the pdm task when we build
|
||||||
|
|
||||||
|
description = 'SimpleChatMCMMO'
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package net.draycia.simplechatmcmmo;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.api.PartyAPI;
|
||||||
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
||||||
|
import net.draycia.simplechat.SimpleChat;
|
||||||
|
import net.draycia.simplechat.channels.impls.SimpleChatChannel;
|
||||||
|
import net.draycia.simplechat.storage.ChatUser;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
public class PartyChatChannel extends SimpleChatChannel implements Listener {
|
||||||
|
|
||||||
|
public PartyChatChannel(String name, SimpleChat simpleChat) {
|
||||||
|
super(name, simpleChat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String processPlaceholders(ChatUser user, String input) {
|
||||||
|
String partyName = PartyAPI.getPartyName(user.asPlayer());
|
||||||
|
|
||||||
|
if (partyName == null) {
|
||||||
|
partyName = "NotLoaded";
|
||||||
|
}
|
||||||
|
|
||||||
|
return input.replace("<party>", partyName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean canPlayerSee(ChatUser sender, ChatUser target, boolean checkSpying) {
|
||||||
|
if (checkSpying && target.asPlayer().hasPermission("simplechat.spy." + getName())) {
|
||||||
|
if (target.getChannelSettings(this).isSpying()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (super.canPlayerSee(sender, target, false) && sender != null) {
|
||||||
|
return PartyAPI.inSameParty(sender.asPlayer(), target.asPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean canPlayerUse(ChatUser user) {
|
||||||
|
return super.canPlayerUse(user) && isInParty(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final McMMOPartyChangeEvent.EventReason LEFT = McMMOPartyChangeEvent.EventReason.LEFT_PARTY;
|
||||||
|
private final McMMOPartyChangeEvent.EventReason KICKED = McMMOPartyChangeEvent.EventReason.KICKED_FROM_PARTY;
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPartyLeave(McMMOPartyChangeEvent event) {
|
||||||
|
if (event.getReason() != LEFT && event.getReason() != KICKED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ChatUser user = getSimpleChat().getUserService().wrap(event.getPlayer());
|
||||||
|
|
||||||
|
if (user.getSelectedChannel() instanceof PartyChatChannel) {
|
||||||
|
user.clearSelectedChannel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
ChatUser user = getSimpleChat().getUserService().wrap(event.getPlayer());
|
||||||
|
|
||||||
|
if ((user.getSelectedChannel() instanceof PartyChatChannel) && !isInParty(user)) {
|
||||||
|
user.clearSelectedChannel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInParty(ChatUser user) {
|
||||||
|
return PartyAPI.inParty(user.asPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package net.draycia.simplechatmcmmo;
|
||||||
|
|
||||||
|
import net.draycia.simplechat.events.ChannelRegisterEvent;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
public final class SimpleChatMCMMO extends JavaPlugin {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
// Plugin startup logic
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
// Plugin shutdown logic
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onChannelRegister(ChannelRegisterEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
name: SimpleChatMCMMO
|
||||||
|
version: ${project.version}
|
||||||
|
main: net.draycia.simplechatmcmmo.SimpleChatMCMMO
|
||||||
|
api-version: 1.16
|
||||||
|
depend: [SimpleChat]
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "me.bristermitten:pdm-gradle:0.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'me.bristermitten.pdm'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
pdm 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72' //This will be added to the dependencies.json
|
||||||
|
|
||||||
|
providedCompile project(':SimpleChat')
|
||||||
|
}
|
||||||
|
|
||||||
|
jar.dependsOn project.tasks.getByName('pdm') // Always run the pdm task when we build
|
||||||
|
|
||||||
|
description = 'SimpleChatModeration'
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<artifactId>SimpleChatParent</artifactId>
|
|
||||||
<groupId>net.draycia</groupId>
|
|
||||||
<version>1.0</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>SimpleChatModeration</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>SimpleChatModeration</name>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<defaultGoal>clean package</defaultGoal>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
|
||||||
<version>3.1.1</version>
|
|
||||||
<configuration>
|
|
||||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.7.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>compile</id>
|
|
||||||
<phase>compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>compile</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>testCompile</id>
|
|
||||||
<phase>test-compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>testCompile</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<source>${java.version}</source>
|
|
||||||
<target>${java.version}</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>jitpack.io</id>
|
|
||||||
<url>https://jitpack.io</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.spigotmc</groupId>
|
|
||||||
<artifactId>spigot-api</artifactId>
|
|
||||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.draycia</groupId>
|
|
||||||
<artifactId>SimpleChat</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.MilkBowl</groupId>
|
|
||||||
<artifactId>VaultAPI</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
+4
-4
@@ -24,14 +24,14 @@ public class ClearChatCommand extends BaseCommand {
|
|||||||
@Default
|
@Default
|
||||||
public void baseCommand(CommandIssuer issuer) {
|
public void baseCommand(CommandIssuer issuer) {
|
||||||
String format = moderation.getConfig().getString("clear-chat.message", "");
|
String format = moderation.getConfig().getString("clear-chat.message", "");
|
||||||
Component component = moderation.getSimpleChat().processMessage(format, "br", "\n");
|
Component component = moderation.getSimpleChat().getAdventureManager().processMessage(format, "br", "\n");
|
||||||
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
if (player.hasPermission("simplechat.clearchat.exempt")) {
|
if (player.hasPermission("simplechat.clearchat.exempt")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Audience audience = moderation.getSimpleChat().getAudiences().player(player);
|
Audience audience = moderation.getSimpleChat().getAdventureManager().getAudiences().player(player);
|
||||||
|
|
||||||
for (int i = 0; i < moderation.getConfig().getInt("clear-chat.message-count", 100); i++) {
|
for (int i = 0; i < moderation.getConfig().getInt("clear-chat.message-count", 100); i++) {
|
||||||
audience.sendMessage(component);
|
audience.sendMessage(component);
|
||||||
@@ -41,12 +41,12 @@ public class ClearChatCommand extends BaseCommand {
|
|||||||
|
|
||||||
if (player.hasPermission("simplechat.clearchat.notify")) {
|
if (player.hasPermission("simplechat.clearchat.notify")) {
|
||||||
String message = moderation.getConfig().getString("language.clear-notify");
|
String message = moderation.getConfig().getString("language.clear-notify");
|
||||||
audience.sendMessage(moderation.getSimpleChat().processMessage(message, "player", name));
|
audience.sendMessage(moderation.getSimpleChat().getAdventureManager().processMessage(message, "player", name));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.hasPermission("simplechat.clearchat.exempt")) {
|
if (player.hasPermission("simplechat.clearchat.exempt")) {
|
||||||
String message = moderation.getConfig().getString("language.clear-exempt");
|
String message = moderation.getConfig().getString("language.clear-exempt");
|
||||||
audience.sendMessage(moderation.getSimpleChat().processMessage(message, "player", name));
|
audience.sendMessage(moderation.getSimpleChat().getAdventureManager().processMessage(message, "player", name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -40,10 +40,10 @@ public class MuteCommand extends BaseCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component message = moderation.getSimpleChat().processMessage(format, "br", "\n",
|
Component message = moderation.getSimpleChat().getAdventureManager().processMessage(format, "br", "\n",
|
||||||
"player", targetUser.asOfflinePlayer().getName());
|
"player", targetUser.asOfflinePlayer().getName());
|
||||||
|
|
||||||
moderation.getSimpleChat().getAudiences().audience(sender).sendMessage(message);
|
moderation.getSimpleChat().getAdventureManager().getAudiences().audience(sender).sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+2
-2
@@ -40,10 +40,10 @@ public class ShadowMuteCommand extends BaseCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component message = moderation.getSimpleChat().processMessage(format, "br", "\n",
|
Component message = moderation.getSimpleChat().getAdventureManager().processMessage(format, "br", "\n",
|
||||||
"player", targetUser.asOfflinePlayer().getName());
|
"player", targetUser.asOfflinePlayer().getName());
|
||||||
|
|
||||||
moderation.getSimpleChat().getAudiences().audience(sender).sendMessage(message);
|
moderation.getSimpleChat().getAdventureManager().getAudiences().audience(sender).sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "me.bristermitten:pdm-gradle:0.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'me.bristermitten.pdm'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
pdm 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72' //This will be added to the dependencies.json
|
||||||
|
|
||||||
|
pdm 'co.aikar:acf-bukkit:0.5.0-SNAPSHOT'
|
||||||
|
pdm 'net.kyori:adventure-api:4.0.0-SNAPSHOT'
|
||||||
|
pdm 'net.kyori:adventure-nbt:4.0.0-SNAPSHOT'
|
||||||
|
pdm 'net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT'
|
||||||
|
pdm 'net.kyori:adventure-text-minimessage:3.0.0-SNAPSHOT'
|
||||||
|
pdm 'de.themoep:minedown:1.6.1-SNAPSHOT'
|
||||||
|
pdm 'co.aikar:idb-bukkit:1.0.0-SNAPSHOT'
|
||||||
|
pdm 'com.zaxxer:HikariCP:2.4.1'
|
||||||
|
pdm 'io.github.leonardosnt:bungeechannelapi:1.0.0-SNAPSHOT'
|
||||||
|
pdm 'io.lettuce:lettuce-core:6.0.0.M1'
|
||||||
|
|
||||||
|
compileOnly 'me.clip:placeholderapi:2.10.6'
|
||||||
|
compileOnly 'com.github.TownyAdvanced:Towny:0.96.1.11'
|
||||||
|
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
|
||||||
|
compileOnly 'com.vexsoftware:nuvotifier-universal:2.6.0'
|
||||||
|
compileOnly 'net.luckperms:api:5.1'
|
||||||
|
compileOnly 'org.jetbrains:annotations:16.0.1'
|
||||||
|
}
|
||||||
|
|
||||||
|
jar.dependsOn project.tasks.getByName('pdm') // Always run the pdm task when we build
|
||||||
|
|
||||||
|
description = 'SimpleChatPlugin'
|
||||||
@@ -1,255 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<artifactId>SimpleChatParent</artifactId>
|
|
||||||
<groupId>net.draycia</groupId>
|
|
||||||
<version>1.0</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>SimpleChat</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>SimpleChat</name>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<defaultGoal>clean package</defaultGoal>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
|
||||||
<version>3.1.1</version>
|
|
||||||
<configuration>
|
|
||||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.7.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>compile</id>
|
|
||||||
<phase>compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>compile</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>testCompile</id>
|
|
||||||
<phase>test-compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>testCompile</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<source>${java.version}</source>
|
|
||||||
<target>${java.version}</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<repositories>
|
|
||||||
<!-- Spigot API -->
|
|
||||||
<repository>
|
|
||||||
<id>spigotmc-repo</id>
|
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- Kyori -->
|
|
||||||
<repository>
|
|
||||||
<id>sonatype</id>
|
|
||||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- PlaceholderAPI -->
|
|
||||||
<repository>
|
|
||||||
<id>placeholderapi</id>
|
|
||||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- Towny, VaultAPI -->
|
|
||||||
<repository>
|
|
||||||
<id>jitpack.io</id>
|
|
||||||
<url>https://jitpack.io</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- ACF -->
|
|
||||||
<repository>
|
|
||||||
<id>aikar</id>
|
|
||||||
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- NuVotifier -->
|
|
||||||
<repository>
|
|
||||||
<id>bintray-repo</id>
|
|
||||||
<url>https://dl.bintray.com/ichbinjoe/public/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- BungeeChannelAPI -->
|
|
||||||
<repository>
|
|
||||||
<id>codemc-repo</id>
|
|
||||||
<url>https://repo.codemc.org/repository/maven-public/</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- MineDown -->
|
|
||||||
<repository>
|
|
||||||
<id>minebench-repo</id>
|
|
||||||
<url>http://repo.minebench.de/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<!-- mcMMO and MiniMessage must be compiled locally -->
|
|
||||||
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.spigotmc</groupId>
|
|
||||||
<artifactId>spigot-api</artifactId>
|
|
||||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- ACF - command framework -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>co.aikar</groupId>
|
|
||||||
<artifactId>acf-bukkit</artifactId>
|
|
||||||
<version>0.5.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Components and formatting -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.kyori</groupId>
|
|
||||||
<artifactId>adventure-api</artifactId>
|
|
||||||
<version>4.0.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.kyori</groupId>
|
|
||||||
<artifactId>adventure-nbt</artifactId>
|
|
||||||
<version>4.0.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.kyori</groupId>
|
|
||||||
<artifactId>adventure-platform-bukkit</artifactId>
|
|
||||||
<version>4.0.0-SNAPSHOT</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<!-- Must be built locally for the time being -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.kyori</groupId>
|
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
|
||||||
<version>3.0.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MineDown, alternative to MiniMessage -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>de.themoep</groupId>
|
|
||||||
<artifactId>minedown</artifactId>
|
|
||||||
<version>1.6.1-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Database stuff -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>co.aikar</groupId>
|
|
||||||
<artifactId>idb-bukkit</artifactId>
|
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.zaxxer</groupId>
|
|
||||||
<artifactId>HikariCP</artifactId>
|
|
||||||
<version>2.4.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Easier bungee handling -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.leonardosnt</groupId>
|
|
||||||
<artifactId>bungeechannelapi</artifactId>
|
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Redis -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.lettuce</groupId>
|
|
||||||
<artifactId>lettuce-core</artifactId>
|
|
||||||
<version>6.0.0.M1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Placeholders -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.clip</groupId>
|
|
||||||
<artifactId>placeholderapi</artifactId>
|
|
||||||
<version>2.10.6</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Towny chats - nation & town -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.TownyAdvanced</groupId>
|
|
||||||
<artifactId>Towny</artifactId>
|
|
||||||
<version>0.96.1.11</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- mcMMO - no repository, add to maven local -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
|
||||||
<artifactId>mcMMO</artifactId>
|
|
||||||
<version>2.1.130</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Vault for permissions / groups -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.MilkBowl</groupId>
|
|
||||||
<artifactId>VaultAPI</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- NuVotifier for vote messages in discord bridge -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.vexsoftware</groupId>
|
|
||||||
<artifactId>nuvotifier-universal</artifactId>
|
|
||||||
<version>2.6.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- LuckPerms for custom contexts -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.luckperms</groupId>
|
|
||||||
<artifactId>api</artifactId>
|
|
||||||
<version>5.1</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,19 +1,12 @@
|
|||||||
package net.draycia.simplechat;
|
package net.draycia.simplechat;
|
||||||
|
|
||||||
import de.themoep.minedown.MineDown;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
|
||||||
import net.draycia.simplechat.listeners.*;
|
import net.draycia.simplechat.listeners.*;
|
||||||
import net.draycia.simplechat.managers.*;
|
import net.draycia.simplechat.managers.*;
|
||||||
import net.draycia.simplechat.storage.UserService;
|
import net.draycia.simplechat.storage.UserService;
|
||||||
import net.draycia.simplechat.storage.impl.JSONUserService;
|
import net.draycia.simplechat.storage.impl.JSONUserService;
|
||||||
import net.draycia.simplechat.storage.impl.MySQLUserService;
|
import net.draycia.simplechat.storage.impl.MySQLUserService;
|
||||||
import net.draycia.simplechat.util.ItemStackUtils;
|
import net.draycia.simplechat.util.ItemStackUtils;
|
||||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
|
||||||
import net.kyori.adventure.text.serializer.bungeecord.BungeeCordComponentSerializer;
|
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@@ -30,17 +23,16 @@ public final class SimpleChat extends JavaPlugin {
|
|||||||
private CommandManager commandManager;
|
private CommandManager commandManager;
|
||||||
private ChannelManager channelManager;
|
private ChannelManager channelManager;
|
||||||
private RedisManager redisManager = null;
|
private RedisManager redisManager = null;
|
||||||
|
private AdventureManager adventureManager;
|
||||||
|
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
private ItemStackUtils itemStackUtils;
|
private ItemStackUtils itemStackUtils;
|
||||||
|
|
||||||
private BukkitAudiences audiences;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// Setup Adventure
|
// Setup Adventure
|
||||||
audiences = BukkitAudiences.create(this);
|
adventureManager = new AdventureManager(this);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
itemStackUtils = new ItemStackUtils();
|
itemStackUtils = new ItemStackUtils();
|
||||||
@@ -106,26 +98,6 @@ public final class SimpleChat extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Component processMessageWithPapi(Player player, String input, String... placeholders) {
|
|
||||||
return processMessage(PlaceholderAPI.setPlaceholders(player, input), placeholders);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Component processMessage(String input, String... placeholders) {
|
|
||||||
switch (getConfig().getString("formatting.type", "minimessage").toLowerCase()) {
|
|
||||||
case "minedown":
|
|
||||||
return processMineDown(input, placeholders);
|
|
||||||
case "minimessage-markdown":
|
|
||||||
return MiniMessage.markdown().parse(input, placeholders);
|
|
||||||
case "minimessage":
|
|
||||||
default:
|
|
||||||
return MiniMessage.get().parse(input, placeholders);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Component processMineDown(String input, String... placeholders) {
|
|
||||||
return BungeeCordComponentSerializer.get().deserialize(MineDown.parse(input, placeholders));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Permission getPermission() {
|
public Permission getPermission() {
|
||||||
return permission;
|
return permission;
|
||||||
}
|
}
|
||||||
@@ -150,11 +122,11 @@ public final class SimpleChat extends JavaPlugin {
|
|||||||
return userService;
|
return userService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BukkitAudiences getAudiences() {
|
|
||||||
return audiences;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStackUtils getItemStackUtils() {
|
public ItemStackUtils getItemStackUtils() {
|
||||||
return itemStackUtils;
|
return itemStackUtils;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AdventureManager getAdventureManager() {
|
||||||
|
return adventureManager;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+7
-13
@@ -5,7 +5,6 @@ import net.draycia.simplechat.channels.ChatChannel;
|
|||||||
import net.draycia.simplechat.events.ChatComponentEvent;
|
import net.draycia.simplechat.events.ChatComponentEvent;
|
||||||
import net.draycia.simplechat.events.ChatFormatEvent;
|
import net.draycia.simplechat.events.ChatFormatEvent;
|
||||||
import net.draycia.simplechat.storage.ChatUser;
|
import net.draycia.simplechat.storage.ChatUser;
|
||||||
import net.kyori.adventure.audience.MessageType;
|
|
||||||
import net.kyori.adventure.text.TextComponent;
|
import net.kyori.adventure.text.TextComponent;
|
||||||
import net.kyori.adventure.text.format.TextColor;
|
import net.kyori.adventure.text.format.TextColor;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@@ -31,15 +30,10 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
this.simpleChat = simpleChat;
|
this.simpleChat = simpleChat;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleChat getSimpleChat() {
|
public SimpleChat getSimpleChat() {
|
||||||
return simpleChat;
|
return simpleChat;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getDiscordFormatting() {
|
|
||||||
return getFormats().getOrDefault("discord-to-mc",
|
|
||||||
"<gray>[<blue>Discord<gray>] <username><white>: <message>");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean canPlayerUse(ChatUser user) {
|
public Boolean canPlayerUse(ChatUser user) {
|
||||||
return user.asPlayer().hasPermission("simplechat.channels." + getName() + ".use");
|
return user.asPlayer().hasPermission("simplechat.channels." + getName() + ".use");
|
||||||
@@ -73,7 +67,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get formatted message
|
// Get formatted message
|
||||||
TextComponent formattedMessage = (TextComponent)simpleChat.processMessage(formatEvent.getFormat(),
|
TextComponent formattedMessage = (TextComponent)simpleChat.getAdventureManager().processMessage(formatEvent.getFormat(),
|
||||||
"br", "\n",
|
"br", "\n",
|
||||||
"color", "<color:" + getColor().toString() + ">",
|
"color", "<color:" + getColor().toString() + ">",
|
||||||
"phase", Long.toString(System.currentTimeMillis() % 25),
|
"phase", Long.toString(System.currentTimeMillis() % 25),
|
||||||
@@ -98,16 +92,16 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
if (isUserSpying(user, chatUser)) {
|
if (isUserSpying(user, chatUser)) {
|
||||||
prefix = prefix.replace("<color>", "<color:" + getColor() + ">");
|
prefix = prefix.replace("<color>", "<color:" + getColor() + ">");
|
||||||
|
|
||||||
chatUser.sendMessage(simpleChat.processMessage(prefix).append(componentEvent.getComponent()), MessageType.CHAT);
|
chatUser.sendMessage(simpleChat.getAdventureManager().processMessage(prefix).append(componentEvent.getComponent()));
|
||||||
} else if (componentEvent.getRecipients().contains(chatUser)) {
|
} else if (componentEvent.getRecipients().contains(chatUser)) {
|
||||||
chatUser.sendMessage(componentEvent.getComponent(), MessageType.CHAT);
|
chatUser.sendMessage(componentEvent.getComponent());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
prefix = prefix.replace("<color>", "<color:" +
|
prefix = prefix.replace("<color>", "<color:" +
|
||||||
chatUser.getChannelSettings(this).getColor().asHexString() + ">");
|
chatUser.getChannelSettings(this).getColor().asHexString() + ">");
|
||||||
String format = formatEvent.getFormat();
|
String format = formatEvent.getFormat();
|
||||||
|
|
||||||
TextComponent newFormat = (TextComponent)simpleChat.processMessage(format,
|
TextComponent newFormat = (TextComponent)simpleChat.getAdventureManager().processMessage(format,
|
||||||
"br", "\n",
|
"br", "\n",
|
||||||
"color", "<color:" + userColor.toString() + ">",
|
"color", "<color:" + userColor.toString() + ">",
|
||||||
"phase", Long.toString(System.currentTimeMillis() % 25),
|
"phase", Long.toString(System.currentTimeMillis() % 25),
|
||||||
@@ -115,7 +109,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
"message", formatEvent.getMessage());
|
"message", formatEvent.getMessage());
|
||||||
|
|
||||||
if (isUserSpying(user, chatUser)) {
|
if (isUserSpying(user, chatUser)) {
|
||||||
newFormat = (TextComponent)simpleChat.processMessage(prefix, "br", "\n")
|
newFormat = (TextComponent)simpleChat.getAdventureManager().processMessage(prefix, "br", "\n")
|
||||||
.append(newFormat);
|
.append(newFormat);
|
||||||
} else if (!componentEvent.getRecipients().contains(chatUser)) {
|
} else if (!componentEvent.getRecipients().contains(chatUser)) {
|
||||||
return;
|
return;
|
||||||
@@ -126,7 +120,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
|
|
||||||
Bukkit.getPluginManager().callEvent(newEvent);
|
Bukkit.getPluginManager().callEvent(newEvent);
|
||||||
|
|
||||||
chatUser.sendMessage(newEvent.getComponent(), MessageType.CHAT);
|
chatUser.sendMessage(newEvent.getComponent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ public class AliasedChannelCommand extends BaseCommand {
|
|||||||
if (args == null || args.length == 0) {
|
if (args == null || args.length == 0) {
|
||||||
user.setSelectedChannel(getChatChannel());
|
user.setSelectedChannel(getChatChannel());
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessage(getChatChannel().getSwitchMessage(),
|
user.sendMessage(simpleChat.getAdventureManager().processMessage(getChatChannel().getSwitchMessage(),
|
||||||
"color", "<" + getChatChannel().getColor().toString() + ">",
|
"color", "<" + getChatChannel().getColor().toString() + ">",
|
||||||
"channel", getChatChannel().getName()));
|
"channel", getChatChannel().getName()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class ChannelCommand extends BaseCommand {
|
|||||||
if (args == null || args.length == 0) {
|
if (args == null || args.length == 0) {
|
||||||
user.setSelectedChannel(channel);
|
user.setSelectedChannel(channel);
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessageWithPapi(player, channel.getSwitchMessage(),
|
user.sendMessage(simpleChat.getAdventureManager().processMessageWithPapi(player, channel.getSwitchMessage(),
|
||||||
"br", "\n",
|
"br", "\n",
|
||||||
"color", "<" + channel.getColor().toString() + ">",
|
"color", "<" + channel.getColor().toString() + ">",
|
||||||
"channel", channel.getName()));
|
"channel", channel.getName()));
|
||||||
@@ -47,10 +47,10 @@ public class ChannelCommand extends BaseCommand {
|
|||||||
String message = channel.getSwitchMessage();
|
String message = channel.getSwitchMessage();
|
||||||
String otherMessage = channel.getSwitchOtherMessage();
|
String otherMessage = channel.getSwitchOtherMessage();
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessage(message, "br", "\n",
|
user.sendMessage(simpleChat.getAdventureManager().processMessage(message, "br", "\n",
|
||||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
||||||
|
|
||||||
simpleChat.getAudiences().audience(sender).sendMessage(simpleChat.processMessage(otherMessage, "br", "\n",
|
simpleChat.getAdventureManager().getAudiences().audience(sender).sendMessage(simpleChat.getAdventureManager().processMessage(otherMessage, "br", "\n",
|
||||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName(),
|
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName(),
|
||||||
"player", user.asOfflinePlayer().getName()));
|
"player", user.asOfflinePlayer().getName()));
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -23,10 +23,10 @@ public class ChatReloadCommand extends BaseCommand {
|
|||||||
simpleChat.reloadConfig();
|
simpleChat.reloadConfig();
|
||||||
simpleChat.reloadPatterns();
|
simpleChat.reloadPatterns();
|
||||||
|
|
||||||
Component message = simpleChat.processMessage(simpleChat.getConfig().getString("language.reloaded"),
|
Component message = simpleChat.getAdventureManager().processMessage(simpleChat.getConfig().getString("language.reloaded"),
|
||||||
"br", "\n");
|
"br", "\n");
|
||||||
|
|
||||||
simpleChat.getAudiences().audience(sender).sendMessage(message);
|
simpleChat.getAdventureManager().getAudiences().audience(sender).sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ public class IgnoreCommand extends BaseCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessageWithPapi(player, message, "br", "\n"));
|
user.sendMessage(simpleChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public class MeCommand extends BaseCommand {
|
|||||||
public void baseCommand(Player player, String... args) {
|
public void baseCommand(Player player, String... args) {
|
||||||
String message = String.join(" ", args).replace("</pre>", "");
|
String message = String.join(" ", args).replace("</pre>", "");
|
||||||
String format = PlaceholderAPI.setPlaceholders(player, simpleChat.getConfig().getString("language.me"));
|
String format = PlaceholderAPI.setPlaceholders(player, simpleChat.getConfig().getString("language.me"));
|
||||||
Component component = simpleChat.processMessage(format, "br", "\n", "message", message);
|
Component component = simpleChat.getAdventureManager().processMessage(format, "br", "\n", "message", message);
|
||||||
|
|
||||||
ChatUser user = simpleChat.getUserService().wrap(player);
|
ChatUser user = simpleChat.getUserService().wrap(player);
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ public class MeCommand extends BaseCommand {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
simpleChat.getAudiences().player(onlinePlayer).sendMessage(component);
|
simpleChat.getAdventureManager().getAudiences().player(onlinePlayer).sendMessage(component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ReplyCommand extends BaseCommand {
|
|||||||
|
|
||||||
if (user.getReplyTarget() == null) {
|
if (user.getReplyTarget() == null) {
|
||||||
String message = simpleChat.getConfig().getString("language.no-reply-target");
|
String message = simpleChat.getConfig().getString("language.no-reply-target");
|
||||||
Component component = simpleChat.processMessage(message, "br", "\n");
|
Component component = simpleChat.getAdventureManager().processMessage(message, "br", "\n");
|
||||||
user.sendMessage(component);
|
user.sendMessage(component);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class SetColorCommand extends BaseCommand {
|
|||||||
|
|
||||||
settings.setColor(TextColor.fromHexString(color));
|
settings.setColor(TextColor.fromHexString(color));
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessageWithPapi(player, simpleChat.getConfig().getString("language.channel-color-set"),
|
user.sendMessage(simpleChat.getAdventureManager().processMessageWithPapi(player, simpleChat.getConfig().getString("language.channel-color-set"),
|
||||||
"br", "\n", "color", "<color:" + color + ">", "channel", channel.getName(), "hex", color));
|
"br", "\n", "color", "<color:" + color + ">", "channel", channel.getName(), "hex", color));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -35,7 +35,7 @@ public class SpyChannelCommand extends BaseCommand {
|
|||||||
message = simpleChat.getConfig().getString("language.spy-toggled-on");
|
message = simpleChat.getConfig().getString("language.spy-toggled-on");
|
||||||
}
|
}
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessageWithPapi(player, message, "br", "\n",
|
user.sendMessage(simpleChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n",
|
||||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ public class SpyChannelCommand extends BaseCommand {
|
|||||||
message = simpleChat.getConfig().getString("language.spy-whispers-on");
|
message = simpleChat.getConfig().getString("language.spy-whispers-on");
|
||||||
}
|
}
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessageWithPapi(player, message, "br", "\n"));
|
user.sendMessage(simpleChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ public class ToggleCommand extends BaseCommand {
|
|||||||
message = channel.getToggleOnMessage();
|
message = channel.getToggleOnMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessageWithPapi(player, message, "br", "\n",
|
user.sendMessage(simpleChat.getAdventureManager().processMessageWithPapi(player, message, "br", "\n",
|
||||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,10 +59,10 @@ public class ToggleCommand extends BaseCommand {
|
|||||||
otherMessage = channel.getToggleOtherOnMessage();
|
otherMessage = channel.getToggleOtherOnMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessage(message, "br", "\n",
|
user.sendMessage(simpleChat.getAdventureManager().processMessage(message, "br", "\n",
|
||||||
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
"color", "<color:" + channel.getColor().toString() + ">", "channel", channel.getName()));
|
||||||
|
|
||||||
simpleChat.getAudiences().audience(sender).sendMessage(simpleChat.processMessage(otherMessage,
|
simpleChat.getAdventureManager().getAudiences().audience(sender).sendMessage(simpleChat.getAdventureManager().processMessage(otherMessage,
|
||||||
"br", "\n", "color", "<color:" + channel.getColor().toString() + ">",
|
"br", "\n", "color", "<color:" + channel.getColor().toString() + ">",
|
||||||
"channel", channel.getName(), "player", user.asOfflinePlayer().getName()));
|
"channel", channel.getName(), "player", user.asOfflinePlayer().getName()));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ public class EmptyChatHandler implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.getUser().sendMessage(simpleChat.processMessage(message));
|
event.getUser().sendMessage(simpleChat.getAdventureManager().processMessage(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package net.draycia.simplechat.managers;
|
||||||
|
|
||||||
|
import de.themoep.minedown.MineDown;
|
||||||
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
|
import net.draycia.simplechat.SimpleChat;
|
||||||
|
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
|
import net.kyori.adventure.text.serializer.bungeecord.BungeeCordComponentSerializer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class AdventureManager {
|
||||||
|
|
||||||
|
private SimpleChat simpleChat;
|
||||||
|
private BukkitAudiences audiences;
|
||||||
|
|
||||||
|
public AdventureManager(SimpleChat simpleChat) {
|
||||||
|
this.simpleChat = simpleChat;
|
||||||
|
this.audiences = BukkitAudiences.create(simpleChat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Component processMessageWithPapi(Player player, String input, String... placeholders) {
|
||||||
|
return processMessage(PlaceholderAPI.setPlaceholders(player, input), placeholders);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Component processMessage(String input, String... placeholders) {
|
||||||
|
switch (simpleChat.getConfig().getString("formatting.type", "minimessage").toLowerCase()) {
|
||||||
|
case "minedown":
|
||||||
|
return processMineDown(input, placeholders);
|
||||||
|
case "minimessage-markdown":
|
||||||
|
return MiniMessage.markdown().parse(input, placeholders);
|
||||||
|
case "minimessage":
|
||||||
|
default:
|
||||||
|
return MiniMessage.get().parse(input, placeholders);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Component processMineDown(String input, String... placeholders) {
|
||||||
|
return BungeeCordComponentSerializer.get().deserialize(MineDown.parse(input, placeholders));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BukkitAudiences getAudiences() {
|
||||||
|
return audiences;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -104,7 +104,7 @@ public class PluginMessageManager implements PluginMessageListener {
|
|||||||
String chatMessage = in.readUTF();
|
String chatMessage = in.readUTF();
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleAsyncDelayedTask(simpleChat, () -> {
|
Bukkit.getScheduler().scheduleAsyncDelayedTask(simpleChat, () -> {
|
||||||
chatChannel.sendComponent(user, simpleChat.processMessage(chatMessage, "br", "\n"));
|
chatChannel.sendComponent(user, simpleChat.getAdventureManager().processMessage(chatMessage, "br", "\n"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ public class PluginMessageManager implements PluginMessageListener {
|
|||||||
String chatMessage = in.readUTF();
|
String chatMessage = in.readUTF();
|
||||||
|
|
||||||
ChatUser target = simpleChat.getUserService().wrap(targetUUID);
|
ChatUser target = simpleChat.getUserService().wrap(targetUUID);
|
||||||
target.sendMessage(simpleChat.processMessage(chatMessage, "br", "\n"));
|
target.sendMessage(simpleChat.getAdventureManager().processMessage(chatMessage, "br", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(ChatChannel chatChannel, Player player, String message) {
|
public void sendMessage(ChatChannel chatChannel, Player player, String message) {
|
||||||
|
|||||||
+4
-4
@@ -45,7 +45,7 @@ public class SimpleChatUser implements ChatUser, ForwardingAudience {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull Iterable<? extends Audience> audiences() {
|
public @NonNull Iterable<? extends Audience> audiences() {
|
||||||
return Collections.singleton(simpleChat.getAudiences().player(uuid));
|
return Collections.singleton(simpleChat.getAdventureManager().getAudiences().player(uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -199,12 +199,12 @@ public class SimpleChatUser implements ChatUser, ForwardingAudience {
|
|||||||
targetName = this.asPlayer().getDisplayName();
|
targetName = this.asPlayer().getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
Component toPlayerComponent = simpleChat.processMessage(toPlayerFormat, "br", "\n",
|
Component toPlayerComponent = simpleChat.getAdventureManager().processMessage(toPlayerFormat, "br", "\n",
|
||||||
"message", message,
|
"message", message,
|
||||||
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
||||||
"target", targetName, "sender", senderName);
|
"target", targetName, "sender", senderName);
|
||||||
|
|
||||||
Component fromPlayerComponent = simpleChat.processMessage(fromPlayerFormat, "br", "\n",
|
Component fromPlayerComponent = simpleChat.getAdventureManager().processMessage(fromPlayerFormat, "br", "\n",
|
||||||
"message", message,
|
"message", message,
|
||||||
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
||||||
"target", targetName, "sender", senderName);
|
"target", targetName, "sender", senderName);
|
||||||
@@ -242,7 +242,7 @@ public class SimpleChatUser implements ChatUser, ForwardingAudience {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.sendMessage(simpleChat.processMessage(simpleChat.getConfig().getString("language.spy-whispers"), "br", "\n",
|
user.sendMessage(simpleChat.getAdventureManager().processMessage(simpleChat.getConfig().getString("language.spy-whispers"), "br", "\n",
|
||||||
"message", message,
|
"message", message,
|
||||||
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
"targetname", targetOfflineName, "sendername", senderOfflineName,
|
||||||
"target", targetName, "sender", senderName));
|
"target", targetName, "sender", senderName));
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* This file was generated by the Gradle 'init' task.
|
||||||
|
*/
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
group = 'net.draycia'
|
||||||
|
version = '1.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
apply plugin: 'war'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
|
||||||
|
maven {url = 'http://repo.maven.apache.org/maven2'}
|
||||||
|
maven {url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'}
|
||||||
|
maven {url = 'https://oss.sonatype.org/content/groups/public/'}
|
||||||
|
maven {url = 'http://repo.extendedclip.com/content/repositories/placeholderapi/'}
|
||||||
|
maven {url = 'https://jitpack.io'}
|
||||||
|
maven {url = 'https://repo.aikar.co/content/groups/aikar/'}
|
||||||
|
maven {url = 'https://dl.bintray.com/ichbinjoe/public/'}
|
||||||
|
maven {url = 'https://repo.codemc.org/repository/maven-public/'}
|
||||||
|
maven {url = 'http://repo.minebench.de/'}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly 'org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT'
|
||||||
|
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
|
||||||
|
|
||||||
|
compileOnly 'co.aikar:acf-bukkit:0.5.0-SNAPSHOT'
|
||||||
|
compileOnly 'net.kyori:adventure-api:4.0.0-SNAPSHOT'
|
||||||
|
compileOnly 'net.kyori:adventure-nbt:4.0.0-SNAPSHOT'
|
||||||
|
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT'
|
||||||
|
compileOnly 'net.kyori:adventure-text-minimessage:3.0.0-SNAPSHOT'
|
||||||
|
compileOnly 'de.themoep:minedown:1.6.1-SNAPSHOT'
|
||||||
|
compileOnly 'co.aikar:idb-bukkit:1.0.0-SNAPSHOT'
|
||||||
|
compileOnly 'com.zaxxer:HikariCP:2.4.1'
|
||||||
|
compileOnly 'io.github.leonardosnt:bungeechannelapi:1.0.0-SNAPSHOT'
|
||||||
|
compileOnly 'io.lettuce:lettuce-core:6.0.0.M1'
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceCompatibility = '1.8'
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
maven(MavenPublication) {
|
||||||
|
from(components.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(Jar) {
|
||||||
|
getDestinationDirectory().set(file("$rootDir/build/bundled"))
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#Sat Jul 18 06:04:19 PDT 2020
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright 2015 the original author or authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
NONSTOP* )
|
||||||
|
nonstop=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Escape application args
|
||||||
|
save () {
|
||||||
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
|
}
|
||||||
|
APP_ARGS=$(save "$@")
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+100
@@ -0,0 +1,100 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<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>net.draycia</groupId>
|
|
||||||
<artifactId>SimpleChatParent</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>SimpleChatPlugin</module>
|
|
||||||
<module>SimpleChatModeration</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<name>SimpleChatParent</name>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<java.version>1.8</java.version>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
</project>
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* This file was generated by the Gradle 'init' task.
|
||||||
|
*/
|
||||||
|
|
||||||
|
rootProject.name = 'SimpleChatParent'
|
||||||
|
include(':SimpleChat')
|
||||||
|
include(':SimpleChatModeration')
|
||||||
|
include(':SimpleChatMCMMO')
|
||||||
|
project(':SimpleChat').projectDir = file('SimpleChatPlugin')
|
||||||
Reference in new issue
Block a user