Skip to content

Commit

Permalink
Merge branch 'master' into config-migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
vLuckyyy committed Aug 23, 2023
2 parents 2d6c337 + 36e2697 commit a0dd948
Show file tree
Hide file tree
Showing 39 changed files with 214 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Checkout
uses: actions/[email protected]
- name: 'Set up JDK ${{ matrix.java }}'
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.12.0
with:
distribution: adopt
java-version: '${{ matrix.java }}'
Expand Down
3 changes: 1 addition & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ repositories {
dependencies {
implementation("net.kyori:blossom:1.3.1")
implementation("com.github.johnrengelman:shadow:8.1.1")
implementation("xyz.jpenilla:run-task:2.1.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0")
implementation("net.minecrell:plugin-yml:0.6.0")
}

Expand Down
22 changes: 1 addition & 21 deletions buildSrc/src/main/kotlin/EternalShadowExtension.kt
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
open class EternalShadowExtension {

internal val libraries: MutableList<String> = mutableListOf()
internal val relocations: MutableList<String> = mutableListOf()

internal val implementationDependencies: MutableList<Any> = mutableListOf()
internal val compileOnlyDependencies: MutableList<String> = mutableListOf()
internal val annotationProcessorDependencies: MutableList<String> = mutableListOf()
internal val modules: MutableList<String> = mutableListOf()
internal val relocations: MutableList<String> = mutableListOf()

fun library(dependency: String) {
this.libraries.add(dependency)
this.compileOnlyDependencies.add(dependency)
}

fun libraryRuntime(dependency: Any) {
this.implementationDependencies.add(dependency)
}

fun libraryRelocate(vararg relocations: String) {
this.relocations.addAll(relocations)
}

fun module(module: String) {
this.modules.add(module)
}

fun onlyCompile(dependency: String) {
this.compileOnlyDependencies.add(dependency)
}

fun annotationProcessors(dependency: String) {
this.annotationProcessorDependencies.add(dependency)
}

}
12 changes: 6 additions & 6 deletions buildSrc/src/main/kotlin/eternalcode-java-test.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ plugins {
}

dependencies {
testImplementation("dev.rollczi.litecommands:core:2.8.8")
testImplementation("dev.rollczi.litecommands:core:2.8.9")
testImplementation("org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT")
testImplementation("net.dzikoysk:cdn:1.14.4")
testImplementation("org.panda-lang:expressible-junit:1.3.5")
testImplementation("org.codehaus.groovy:groovy-all:3.0.18")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3")
testImplementation("org.mockito:mockito-core:5.4.0")
testImplementation("org.codehaus.groovy:groovy-all:3.0.19")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.0")
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("net.kyori:adventure-platform-bukkit:4.3.0")
testImplementation("net.kyori:adventure-platform-facet:4.3.0")
testImplementation("net.kyori:adventure-text-minimessage:4.14.0")
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/eternalcode-java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ group = "com.eternalcode"
version = "1.0.0"

checkstyle {
toolVersion = "10.12.1"
toolVersion = "10.12.2"

configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")

Expand Down
11 changes: 0 additions & 11 deletions buildSrc/src/main/kotlin/eternalcode-paper-run.gradle.kts

This file was deleted.

12 changes: 0 additions & 12 deletions buildSrc/src/main/kotlin/eternalcore-shadow.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,8 @@ val extension = extensions.create<EternalShadowExtension>("eternalShadow")

afterEvaluate {
dependencies {
extension.implementationDependencies.forEach {
api(it)
}

extension.compileOnlyDependencies.forEach {
compileOnlyApi(it)
}

extension.annotationProcessorDependencies.forEach {
annotationProcessor(it)
}

extension.modules.forEach {
api(project(it))
}
}
}
27 changes: 16 additions & 11 deletions eternalcore-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@ plugins {
`eternalcore-shadow`
}

eternalShadow {
dependencies {
// modules
module(":eternalcore-api")
module(":eternalcore-paper")
module(":eternalcore-docs-api")
implementation(project(":eternalcore-api"))
implementation(project(":eternalcore-paper"))
implementation(project(":eternalcore-docs-api"))

// Base libraries
compileOnly("org.jetbrains:annotations:24.0.1")

// Minecraft API
onlyCompile("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
// Minecraft & Bridges API
compileOnlyApi("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.3")

onlyCompile("me.clip:placeholderapi:2.11.3")
onlyCompile("org.projectlombok:lombok:1.18.28")
onlyCompile("org.jetbrains:annotations:24.0.1")
annotationProcessors("org.projectlombok:lombok:1.18.28")
// Lombok
compileOnly("org.projectlombok:lombok:1.18.28")
annotationProcessor("org.projectlombok:lombok:1.18.28")
}

eternalShadow {
// Paper and Adventure libraries
library("io.papermc:paperlib:1.0.8")
library("net.kyori:adventure-platform-bukkit:4.3.0")
Expand All @@ -43,7 +48,7 @@ eternalShadow {
)

// command framework & skull library
library("dev.rollczi.litecommands:bukkit-adventure:2.8.8")
library("dev.rollczi.litecommands:bukkit-adventure:2.8.9")
library("dev.rollczi:liteskullapi:1.3.0")
libraryRelocate(
"dev.rollczi.litecommands",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import com.eternalcode.core.feature.essentials.playerinfo.OnlinePlayersListCommand;
import com.eternalcode.core.feature.essentials.playerinfo.PingCommand;
import com.eternalcode.core.feature.essentials.playerinfo.WhoIsCommand;
import com.eternalcode.core.feature.essentials.tellraw.TellRawCommand;
import com.eternalcode.core.feature.essentials.time.DayCommand;
import com.eternalcode.core.feature.essentials.time.NightCommand;
import com.eternalcode.core.feature.essentials.time.TimeCommand;
Expand Down Expand Up @@ -405,6 +406,7 @@ public EternalCore(Plugin plugin) {
new AdminChatCommand(this.noticeService, server),
new HelpOpCommand(this.noticeService, pluginConfiguration, server),
new AlertCommand(this.noticeService),
new TellRawCommand(this.noticeService),

// Moderation Commands
new FlyCommand(this.noticeService),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.bukkit.entity.Player;

@Route(name = "feed")
@Permission("eternalcore.feed")
public class FeedCommand {

private final NoticeService noticeService;
Expand All @@ -20,6 +19,7 @@ public FeedCommand(NoticeService noticeService) {
}

@Execute
@Permission("eternalcore.feed")
@DescriptionDocs(description = "Feed yourself")
void execute(Player player) {
this.feed(player);
Expand All @@ -31,6 +31,7 @@ void execute(Player player) {
}

@Execute
@Permission("eternalcore.feed.other")
@DescriptionDocs(description = "Feed other player", arguments = "<player>")
void execute(Viewer viewer, @Arg Player target) {
this.feed(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.bukkit.entity.Player;

@Route(name = "fly")
@Permission("eternalcore.fly")
public class FlyCommand {

private final NoticeService noticeService;
Expand All @@ -20,6 +19,7 @@ public FlyCommand(NoticeService noticeService) {
}

@Execute
@Permission("eternalcore.fly")
@DescriptionDocs(description = "Toggle fly mode")
void execute(Player player) {
player.setAllowFlight(!player.getAllowFlight());
Expand All @@ -32,6 +32,7 @@ void execute(Player player) {
}

@Execute(required = 1)
@Permission("eternalcore.fly.other")
@DescriptionDocs(description = "Toggle fly mode for specified player", arguments = "<player>")
void execute(Viewer viewer, @Arg Player target) {
target.setAllowFlight(!target.getAllowFlight());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.bukkit.entity.Player;

@Route(name = "god", aliases = "godmode")
@Permission("eternalcore.god")
public class GodCommand {

private final NoticeService noticeService;
Expand All @@ -20,6 +19,7 @@ public GodCommand(NoticeService noticeService) {
}

@Execute
@Permission("eternalcore.god")
@DescriptionDocs(description = "Toggle god mode")
void execute(Player sender) {
sender.setInvulnerable(!sender.isInvulnerable());
Expand All @@ -32,6 +32,7 @@ void execute(Player sender) {
}

@Execute(required = 1)
@Permission("eternalcore.god.other")
@DescriptionDocs(description = "Toggle god mode for specified player", arguments = "<player>")
void execute(Viewer viewer, @Arg Player target) {
target.setInvulnerable(!target.isInvulnerable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.bukkit.potion.PotionEffect;

@Route(name = "heal")
@Permission("eternalcore.heal")
public class HealCommand {

private final NoticeService noticeService;
Expand All @@ -21,6 +20,7 @@ public HealCommand(NoticeService noticeService) {
}

@Execute
@Permission("eternalcore.heal")
@DescriptionDocs(description = "Heal yourself")
void execute(Player player) {
this.heal(player);
Expand All @@ -29,6 +29,7 @@ void execute(Player player) {
}

@Execute
@Permission("eternalcore.heal.other")
@DescriptionDocs(description = "Heal other player", arguments = "<player>")
void execute(Viewer viewer, @Arg Player target) {
this.heal(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ public KillCommand(NoticeService noticeService) {
this.noticeService = noticeService;
}

@Execute
@DescriptionDocs(description = "Kill yourself")
void execute(Player player) {
player.setHealth(0);

this.noticeService.create()
.notice(translation -> translation.player().killedMessage())
.placeholder("{PLAYER}", player.getName())
.player(player.getUniqueId())
.send();
}

@Execute
@DescriptionDocs(description = "Kill specified player", arguments = "<player>")
void execute(Viewer audience, @Arg Player player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.bukkit.entity.Player;

@Route(name = "anvil")
@Permission("eternalcore.anvil")
public class AnvilCommand {

private final NoticeService noticeService;
Expand All @@ -20,6 +19,7 @@ public AnvilCommand(NoticeService noticeService) {
}

@Execute(required = 0)
@Permission("eternalcore.anvil")
@DescriptionDocs(description = "Opens an anvil for you")
void executeSelf(Player player) {
AdditionalContainerPaper.ANVIL.open(player);
Expand All @@ -31,6 +31,7 @@ void executeSelf(Player player) {
}

@Execute(required = 1)
@Permission("eternalcore.anvil.other")
@DescriptionDocs(description = "Opens an anvil for another player", arguments = "<player>")
void execute(Player sender, @Arg Player target) {
AdditionalContainerPaper.ANVIL.open(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.bukkit.entity.Player;

@Route(name = "cartography", aliases = "cartography-table")
@Permission("eternalcore.cartography")
public class CartographyTableCommand {

private final NoticeService noticeService;
Expand All @@ -21,6 +20,7 @@ public CartographyTableCommand(NoticeService noticeService) {
}

@Execute(required = 0)
@Permission("eternalcore.cartography")
@DescriptionDocs(description = "Opens a cartography table for you")
void executeSelf(Player player) {
AdditionalContainerPaper.CARTOGRAPHY_TABLE.open(player);
Expand All @@ -32,6 +32,7 @@ void executeSelf(Player player) {
}

@Execute(required = 1)
@Permission("eternalcore.cartography.other")
@DescriptionDocs(description = "Opens a cartography table for another player", arguments = "<player>")
void execute(Player sender, @Arg Player target) {
AdditionalContainerPaper.CARTOGRAPHY_TABLE.open(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.bukkit.entity.Player;

@Route(name = "enderchest", aliases = { "ec" })
@Permission("eternalcore.enderchest")
public class EnderchestCommand {

private final NoticeService noticeService;
Expand All @@ -20,6 +19,7 @@ public EnderchestCommand(NoticeService noticeService) {
}

@Execute(required = 0)
@Permission("eternalcore.enderchest")
@DescriptionDocs(description = "Opens your enderchest")
void execute(Player player) {
player.openInventory(player.getEnderChest());
Expand All @@ -31,6 +31,7 @@ void execute(Player player) {
}

@Execute(required = 1)
@Permission("eternalcore.enderchest.other")
@DescriptionDocs(description = "Opens another player his enderchest", arguments = "<player>")
void execute(Player player, @Arg Player target) {
player.openInventory(target.getEnderChest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.bukkit.entity.Player;

@Route(name = "grindstone")
@Permission("eternalcore.grindstone")
public class GrindstoneCommand {

private final NoticeService announcer;
Expand All @@ -21,6 +20,7 @@ public GrindstoneCommand(NoticeService announcer) {
}

@Execute(required = 0)
@Permission("eternalcore.grindstone")
@DescriptionDocs(description = "Opens a grindstone for you")
void executeSelf(Player player) {
AdditionalContainerPaper.GRINDSTONE.open(player);
Expand All @@ -32,6 +32,7 @@ void executeSelf(Player player) {
}

@Execute(required = 1)
@Permission("eternalcore.grindstone.other")
@DescriptionDocs(description = "Opens a grindstone for another player", arguments = "<player>")
void execute(Player sender, @Arg Player target) {
AdditionalContainerPaper.GRINDSTONE.open(target);
Expand Down
Loading

0 comments on commit a0dd948

Please sign in to comment.