mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
12 files changed
+79
-18
No files matched your search
@@ -10,6 +10,7 @@ repositories {
|
||||
dependencies {
|
||||
implementation(libs.shadow)
|
||||
implementation(libs.indraCommon)
|
||||
implementation(libs.indraLicenseHeader)
|
||||
implementation(libs.licenser)
|
||||
|
||||
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
|
||||
|
||||
+11
-1
@@ -34,12 +34,15 @@ import net.draycia.carbon.common.command.CommandSettings;
|
||||
import net.draycia.carbon.common.command.Commander;
|
||||
import net.draycia.carbon.common.command.PlayerCommander;
|
||||
import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
|
||||
import net.draycia.carbon.common.config.ConfigFactory;
|
||||
import net.draycia.carbon.common.messages.CarbonMessages;
|
||||
import net.draycia.carbon.common.util.CloudUtils;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
|
||||
@DefaultQualifier(NonNull.class)
|
||||
@@ -48,16 +51,19 @@ public class ContinueCommand extends CarbonCommand {
|
||||
final CarbonChat carbonChat;
|
||||
final CommandManager<Commander> commandManager;
|
||||
final CarbonMessages carbonMessages;
|
||||
final ConfigFactory configFactory;
|
||||
|
||||
@Inject
|
||||
public ContinueCommand(
|
||||
final CarbonChat carbonChat,
|
||||
final CommandManager<Commander> commandManager,
|
||||
final CarbonMessages carbonMessages
|
||||
final CarbonMessages carbonMessages,
|
||||
final ConfigFactory configFactory
|
||||
) {
|
||||
this.carbonChat = carbonChat;
|
||||
this.commandManager = commandManager;
|
||||
this.carbonMessages = carbonMessages;
|
||||
this.configFactory = configFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,6 +134,10 @@ public class ContinueCommand extends CarbonCommand {
|
||||
this.carbonMessages.whisperRecipient(new SourcedAudience(sender, recipient), senderName, recipientName, message);
|
||||
this.carbonMessages.whisperConsoleLog(this.carbonChat.server().console(), senderName, recipientName, message);
|
||||
|
||||
final @Nullable Sound messageSound = this.configFactory.primaryConfig().messageSound();
|
||||
if (messageSound != null) {
|
||||
recipient.playSound(messageSound);
|
||||
}
|
||||
sender.lastWhisperTarget(recipient.uuid());
|
||||
sender.whisperReplyTarget(recipient.uuid());
|
||||
recipient.whisperReplyTarget(sender.uuid());
|
||||
|
||||
@@ -34,9 +34,11 @@ import net.draycia.carbon.common.command.CommandSettings;
|
||||
import net.draycia.carbon.common.command.Commander;
|
||||
import net.draycia.carbon.common.command.PlayerCommander;
|
||||
import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
|
||||
import net.draycia.carbon.common.config.ConfigFactory;
|
||||
import net.draycia.carbon.common.messages.CarbonMessages;
|
||||
import net.draycia.carbon.common.util.CloudUtils;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
@@ -49,16 +51,19 @@ public class ReplyCommand extends CarbonCommand {
|
||||
final CarbonChat carbonChat;
|
||||
final CommandManager<Commander> commandManager;
|
||||
final CarbonMessages carbonMessages;
|
||||
final ConfigFactory configFactory;
|
||||
|
||||
@Inject
|
||||
public ReplyCommand(
|
||||
final CarbonChat carbonChat,
|
||||
final CommandManager<Commander> commandManager,
|
||||
final CarbonMessages carbonMessages
|
||||
final CarbonMessages carbonMessages,
|
||||
final ConfigFactory configFactory
|
||||
) {
|
||||
this.carbonChat = carbonChat;
|
||||
this.commandManager = commandManager;
|
||||
this.carbonMessages = carbonMessages;
|
||||
this.configFactory = configFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,6 +133,10 @@ public class ReplyCommand extends CarbonCommand {
|
||||
this.carbonMessages.whisperRecipient(new SourcedAudience(sender, recipient), senderName, recipientName, message);
|
||||
this.carbonMessages.whisperConsoleLog(this.carbonChat.server().console(), senderName, recipientName, message);
|
||||
|
||||
final @Nullable Sound messageSound = this.configFactory.primaryConfig().messageSound();
|
||||
if (messageSound != null) {
|
||||
recipient.playSound(messageSound);
|
||||
}
|
||||
sender.lastWhisperTarget(recipient.uuid());
|
||||
sender.whisperReplyTarget(recipient.uuid());
|
||||
recipient.whisperReplyTarget(sender.uuid());
|
||||
|
||||
+11
-1
@@ -33,11 +33,14 @@ import net.draycia.carbon.common.command.Commander;
|
||||
import net.draycia.carbon.common.command.PlayerCommander;
|
||||
import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
|
||||
import net.draycia.carbon.common.command.argument.PlayerSuggestions;
|
||||
import net.draycia.carbon.common.config.ConfigFactory;
|
||||
import net.draycia.carbon.common.messages.CarbonMessages;
|
||||
import net.draycia.carbon.common.util.CloudUtils;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
|
||||
@DefaultQualifier(NonNull.class)
|
||||
@@ -47,18 +50,21 @@ public class WhisperCommand extends CarbonCommand {
|
||||
final CommandManager<Commander> commandManager;
|
||||
final CarbonMessages carbonMessages;
|
||||
final PlayerSuggestions playerSuggestions;
|
||||
final ConfigFactory configFactory;
|
||||
|
||||
@Inject
|
||||
public WhisperCommand(
|
||||
final CarbonChat carbonChat,
|
||||
final CommandManager<Commander> commandManager,
|
||||
final CarbonMessages carbonMessages,
|
||||
final PlayerSuggestions playerSuggestions
|
||||
final PlayerSuggestions playerSuggestions,
|
||||
final ConfigFactory configFactory
|
||||
) {
|
||||
this.carbonChat = carbonChat;
|
||||
this.commandManager = commandManager;
|
||||
this.carbonMessages = carbonMessages;
|
||||
this.playerSuggestions = playerSuggestions;
|
||||
this.configFactory = configFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,6 +128,10 @@ public class WhisperCommand extends CarbonCommand {
|
||||
this.carbonMessages.whisperRecipient(new SourcedAudience(sender, recipient), senderName, recipientName, message);
|
||||
this.carbonMessages.whisperConsoleLog(this.carbonChat.server().console(), senderName, recipientName, message);
|
||||
|
||||
final @Nullable Sound messageSound = this.configFactory.primaryConfig().messageSound();
|
||||
if (messageSound != null) {
|
||||
recipient.playSound(messageSound);
|
||||
}
|
||||
sender.lastWhisperTarget(recipient.uuid());
|
||||
sender.whisperReplyTarget(recipient.uuid());
|
||||
recipient.whisperReplyTarget(sender.uuid());
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
@@ -69,6 +70,14 @@ public class PrimaryConfig {
|
||||
@Comment("Various settings related to pinging players in channels.")
|
||||
private PingSettings pingSettings = new PingSettings();
|
||||
|
||||
@Comment("Various sound settings for messages.")
|
||||
private @Nullable Sound messageSound = Sound.sound(
|
||||
Key.key("entity.experience_orb.pickup"),
|
||||
Sound.Source.MASTER,
|
||||
1.0F,
|
||||
1.0F
|
||||
);
|
||||
|
||||
private MessagingSettings messagingSettings = new MessagingSettings();
|
||||
|
||||
public Locale defaultLocale() {
|
||||
@@ -111,6 +120,10 @@ public class PrimaryConfig {
|
||||
return this.messagingSettings;
|
||||
}
|
||||
|
||||
public @Nullable Sound messageSound() {
|
||||
return this.messageSound;
|
||||
}
|
||||
|
||||
public enum StorageType {
|
||||
JSON,
|
||||
MYSQL,
|
||||
|
||||
@@ -6,11 +6,11 @@ metadata:
|
||||
plugins:
|
||||
net.kyori.blossom: 1.3.0
|
||||
net.minecrell.plugin-yml.bukkit: 0.5.1
|
||||
org.spongepowered.gradle.plugin: 2.0.2
|
||||
org.spongepowered.gradle.plugin: 2.1.1
|
||||
xyz.jpenilla.run-paper: 2.0.1
|
||||
|
||||
versions:
|
||||
indra: 2.2.0
|
||||
indra: 3.0.1
|
||||
licenser: 0.6.1
|
||||
shadow: 7.1.2
|
||||
adventure: 4.12.0
|
||||
@@ -290,6 +290,10 @@ dependencies:
|
||||
group: net.kyori
|
||||
name: indra-common
|
||||
version: { ref: indra }
|
||||
indraLicenseHeader:
|
||||
group: net.kyori
|
||||
name: indra-licenser-cadix
|
||||
version: { ref: indra }
|
||||
shadow:
|
||||
group: gradle.plugin.com.github.johnrengelman
|
||||
name: shadow
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,5 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -80,10 +80,10 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# 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"'
|
||||
@@ -143,12 +143,16 @@ fi
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -205,6 +209,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
||||
Vendored
+9
-6
@@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -25,7 +25,8 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 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
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ sequenceOf(
|
||||
"api",
|
||||
"common",
|
||||
"paper",
|
||||
"sponge",
|
||||
// "sponge", // TODO API 10
|
||||
// "fabric", // TODO 1.19.3
|
||||
"velocity"
|
||||
).forEach {
|
||||
|
||||
@@ -27,7 +27,7 @@ tasks {
|
||||
|
||||
sponge {
|
||||
injectRepositories(false) // We specify repositories in settings.gradle.kts
|
||||
apiVersion("9.0.0-SNAPSHOT")
|
||||
apiVersion("10.0.0-SNAPSHOT")
|
||||
plugin(rootProject.name.toLowerCase(Locale.ROOT)) {
|
||||
loader {
|
||||
name(PluginLoaders.JAVA_PLAIN)
|
||||
|
||||
Reference in new issue
Block a user