Skip to content

Commit

Permalink
Merge branch 'trunk' into guice-7
Browse files Browse the repository at this point in the history
  • Loading branch information
Draycia committed Jun 12, 2024
2 parents 790ef49 + 5541935 commit e7fbee8
Show file tree
Hide file tree
Showing 67 changed files with 1,002 additions and 875 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: gradle/actions/wrapper-validation@v3
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
Expand Down
28 changes: 28 additions & 0 deletions api/src/main/java/net/draycia/carbon/api/channels/ChatChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,32 @@ public interface ChatChannel extends Keyed, ChatComponentRenderer {
*/
boolean emptyRadiusRecipientsMessage();

/**
* The time in milliseconds between player messages.
* -1 and 0 disable the cooldown for this channel.
*
* @return The message cooldown in millis.
* @since 3.0.0
*/
long cooldown();

/**
* The epoch time (millis) when the player's cooldown expires.
*
* @param player The player
* @return The epoch time (millis) when the player's cooldown expires.
* @since 3.0.0
*/
long playerCooldown(CarbonPlayer player);

/**
* Starts the cooldown timer for the specified player. Duration will be the channel cooldown.
* Returns the player's old cooldown time, if they have one.
*
* @param player The player
* @return The player's old cooldown, or 0 if they don't have one.
* @since 3.0.0
*/
long startCooldown(CarbonPlayer player);

}
5 changes: 0 additions & 5 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ dependencies {
implementation(libs.gremlin.gradle)
implementation(libs.run.task)

implementation(libs.pluginYml)
// Implementation dependencies of plugin-yml
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.16.1")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.1")

// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
60 changes: 0 additions & 60 deletions build-logic/src/main/kotlin/PaperPlugin.kt

This file was deleted.

99 changes: 0 additions & 99 deletions build-logic/src/main/kotlin/PaperPluginDescription.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ indraSpotlessLicenser {

tasks {
withType<JavaCompile> {
// disable 'warning: No processor claimed any of these annotations' spam
options.compilerArgs.add("-Xlint:-processing")
// disable unclaimed annotation and missing annotation warnings
options.compilerArgs.add("-Xlint:-processing,-classfile")
options.compilerArgs.add("-parameters")
}
}
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fun Task.standardRelocations() {
}

fun Task.relocateCloud() {
relocateDependency("cloud.commandframework")
relocateDependency("org.incendo.cloud")
}

fun Task.relocateGuice() {
Expand Down
1 change: 0 additions & 1 deletion build-logic/src/main/kotlin/paper-plugin-yml.gradle.kts

This file was deleted.

2 changes: 2 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ dependencies {
// Cloud
api(platform(libs.cloudBom))
api(libs.cloudCore)
api(platform(libs.cloudMinecraftBom))
api(libs.cloudMinecraftExtras) {
isTransitive = false
}
api(libs.cloudSigned)

// Other
compileOnlyApi(libs.guice) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
import net.draycia.carbon.api.event.CarbonEventHandler;
import net.draycia.carbon.api.users.UserManager;
import net.draycia.carbon.common.channels.CarbonChannelRegistry;
import net.draycia.carbon.common.command.ArgumentFactory;
import net.draycia.carbon.common.command.CarbonCommand;
import net.draycia.carbon.common.command.ExecutionCoordinatorHolder;
import net.draycia.carbon.common.command.ParserFactory;
import net.draycia.carbon.common.command.argument.PlayerSuggestions;
import net.draycia.carbon.common.command.commands.ClearChatCommand;
import net.draycia.carbon.common.command.commands.ContinueCommand;
Expand Down Expand Up @@ -86,6 +86,7 @@
import net.draycia.carbon.common.messages.placeholders.ComponentPlaceholderResolver;
import net.draycia.carbon.common.messages.placeholders.IntPlaceholderResolver;
import net.draycia.carbon.common.messages.placeholders.KeyPlaceholderResolver;
import net.draycia.carbon.common.messages.placeholders.LongPlaceholderResolver;
import net.draycia.carbon.common.messages.placeholders.OptionPlaceholderResolver;
import net.draycia.carbon.common.messages.placeholders.StringPlaceholderResolver;
import net.draycia.carbon.common.messages.placeholders.UUIDPlaceholderResolver;
Expand Down Expand Up @@ -166,6 +167,7 @@ public CarbonMessages carbonMessages(
final UUIDPlaceholderResolver<Audience> uuidPlaceholderResolver,
final StringPlaceholderResolver<Audience> stringPlaceholderResolver,
final IntPlaceholderResolver<Audience> intPlaceholderResolver,
final LongPlaceholderResolver<Audience> longPlaceholderResolver,
final KeyPlaceholderResolver<Audience> keyPlaceholderResolver,
final BooleanPlaceholderResolver<Audience> booleanPlaceholderResolver,
final CarbonMessageSource carbonMessageSource,
Expand All @@ -182,6 +184,7 @@ public CarbonMessages carbonMessages(
.weightedPlaceholderResolver(UUID.class, uuidPlaceholderResolver, 0)
.weightedPlaceholderResolver(String.class, stringPlaceholderResolver, 0)
.weightedPlaceholderResolver(Integer.class, intPlaceholderResolver, 0)
.weightedPlaceholderResolver(Long.class, longPlaceholderResolver, 0)
.weightedPlaceholderResolver(Key.class, keyPlaceholderResolver, 0)
.weightedPlaceholderResolver(Boolean.class, booleanPlaceholderResolver, 0)
.weightedPlaceholderResolver(Option.class, new OptionPlaceholderResolver<>(), 0)
Expand All @@ -196,7 +199,7 @@ public ExecutionCoordinatorHolder executionCoordinatorHolder(final Logger logger

@Override
protected void configure() {
this.install(new FactoryModuleBuilder().build(ArgumentFactory.class));
this.install(new FactoryModuleBuilder().build(ParserFactory.class));
this.install(factoryModule(PacketFactory.class));
this.bind(ServerId.KEY).toInstance(UUID.randomUUID());
this.bind(ChannelRegistry.class).to(CarbonChannelRegistry.class);
Expand Down
35 changes: 35 additions & 0 deletions common/src/main/java/net/draycia/carbon/common/RawChat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* CarbonChat
*
* Copyright (c) 2024 Josua Parks (Vicarious)
* Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.draycia.carbon.common;

import com.google.inject.BindingAnnotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Injection binding annotation for the raw chat type key.
*/
@BindingAnnotation
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD})
public @interface RawChat {
}

0 comments on commit e7fbee8

Please sign in to comment.