Skip to content

Commit

Permalink
Merge branch 'release/v2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
renbinden committed Dec 20, 2022
2 parents 6bd1703 + 6600d7e commit 2d696b6
Show file tree
Hide file tree
Showing 299 changed files with 5,248 additions and 8,373 deletions.
49 changes: 3 additions & 46 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ buildscript {
}

plugins {
id "com.github.breadmoirai.github-release" version "2.2.12"
id "org.jetbrains.kotlin.jvm" version "1.7.0" apply false
id "org.jetbrains.kotlin.jvm" version "1.7.22" apply false
id "maven-publish"
id "org.jetbrains.dokka" version "1.7.0" apply false
id "org.jetbrains.dokka" version "1.7.20" apply false
}

repositories {
Expand All @@ -38,7 +37,7 @@ allprojects {
apply plugin: "maven-publish"
apply plugin: "org.jetbrains.dokka"
group = "com.rpkit"
version = "2.3.3"
version = "2.4.0"
}

subprojects {
Expand Down Expand Up @@ -66,45 +65,3 @@ subprojects {
}
}
}

def githubToken = ""
def githubPropertiesFile = new File("github.properties")
if (githubPropertiesFile.exists()) {
def githubProperties = new Properties()
githubProperties.load(new FileInputStream(githubPropertiesFile))
githubToken = githubProperties.get("token")
}

githubRelease {
token githubToken
owner "RP-Kit"
repo "RPKit"
releaseName "Version " + version
releaseAssets subprojects.stream()
.flatMap { subproject ->
subproject.evaluate()
def noSource = true
def sourceSets = subproject.sourceSets
for (sourceSet in sourceSets) {
noSource = !sourceSet.allSource.isEmpty() || !noSource
}
if (!noSource) {
def files = subproject.tasks.jar.outputs.getFiles().getFiles().stream()
if (subproject.tasks.findByName("shadowJar")) {
files = subproject.tasks.shadowJar.outputs.getFiles().getFiles().stream()
}
files
} else {
Arrays.stream(new File[0])
}
}.toArray { size -> new File[size] }
}

subprojects.forEach { subproject ->
subproject.evaluate()
if (subproject.tasks.findByName("shadowJar")) {
project.tasks.githubRelease.dependsOn subproject.tasks.shadowJar
} else {
project.tasks.githubRelease.dependsOn subproject.tasks.jar
}
}
6 changes: 3 additions & 3 deletions bukkit/rpk-auction-lib-bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ if (propertiesFile.exists()) {
}

dependencies {
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.0"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.0"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19-R0.1-SNAPSHOT"
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.22"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.22"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19.3-R0.1-SNAPSHOT"
implementation group: "org.bstats", name: "bstats-bukkit", version: "3.0.0"
implementation project(":rpk-core")
implementation project(":bukkit:rpk-core-bukkit")
Expand Down
8 changes: 4 additions & 4 deletions bukkit/rpk-auctions-bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ if (propertiesFile.exists()) {
}

dependencies {
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.0"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.0"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19-R0.1-SNAPSHOT"
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.22"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.22"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19.3-R0.1-SNAPSHOT"
implementation group: "org.bstats", name: "bstats-bukkit", version: "3.0.0"
implementation group: "org.jooq", name: "jooq", version: "3.16.6"
implementation group: "org.jooq", name: "jooq", version: "3.17.6"
implementation project(":rpk-core")
implementation project(":bukkit:rpk-core-bukkit")
implementation project(":bukkit:rpk-player-lib-bukkit")
Expand Down
6 changes: 3 additions & 3 deletions bukkit/rpk-bank-lib-bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ if (propertiesFile.exists()) {
}

dependencies {
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.0"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.0"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19-R0.1-SNAPSHOT"
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.22"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.22"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19.3-R0.1-SNAPSHOT"
implementation group: "org.bstats", name: "bstats-bukkit", version: "3.0.0"
implementation group: "net.milkbowl.vault", name: "VaultAPI", version: "1.7"
implementation project(":rpk-core")
Expand Down
8 changes: 4 additions & 4 deletions bukkit/rpk-banks-bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ if (propertiesFile.exists()) {
}

dependencies {
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.0"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.0"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19-R0.1-SNAPSHOT"
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.22"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.22"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19.3-R0.1-SNAPSHOT"
implementation group: "org.bstats", name: "bstats-bukkit", version: "3.0.0"
implementation group: "net.milkbowl.vault", name: "VaultAPI", version: "1.7"
implementation group: "org.jooq", name: "jooq", version: "3.16.6"
implementation group: "org.jooq", name: "jooq", version: "3.17.6"
implementation project(":rpk-core")
implementation project(":bukkit:rpk-core-bukkit")
implementation project(":bukkit:rpk-player-lib-bukkit")
Expand Down
6 changes: 3 additions & 3 deletions bukkit/rpk-block-log-lib-bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ if (propertiesFile.exists()) {
}

dependencies {
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.0"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.0"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19-R0.1-SNAPSHOT"
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.22"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.22"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19.3-R0.1-SNAPSHOT"
implementation group: "org.bstats", name: "bstats-bukkit", version: "3.0.0"
implementation project(":rpk-core")
implementation project(":bukkit:rpk-core-bukkit")
Expand Down
8 changes: 4 additions & 4 deletions bukkit/rpk-block-logging-bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ if (propertiesFile.exists()) {
}

dependencies {
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.0"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.0"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19-R0.1-SNAPSHOT"
implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: "1.7.22"
implementation group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: "1.7.22"
implementation group: "org.spigotmc", name: "spigot-api", version: "1.19.3-R0.1-SNAPSHOT"
implementation group: "org.bstats", name: "bstats-bukkit", version: "3.0.0"
implementation group: "org.jooq", name: "jooq", version: "3.16.6"
implementation group: "org.jooq", name: "jooq", version: "3.17.6"
implementation project(":rpk-core")
implementation project(":bukkit:rpk-core-bukkit")
implementation project(":bukkit:rpk-player-lib-bukkit")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class RPKBlockHistoryTable(private val database: Database, private val plugin: R
)
.from(RPKIT_BLOCK_HISTORY)
.where(RPKIT_BLOCK_HISTORY.ID.eq(id.value))
.orderBy(RPKIT_BLOCK_HISTORY.ID)
.limit(1)
.fetchOne() ?: return@supplyAsync null
val blockHistory = RPKBlockHistoryImpl(
plugin,
Expand Down Expand Up @@ -127,6 +129,8 @@ class RPKBlockHistoryTable(private val database: Database, private val plugin: R
.and(RPKIT_BLOCK_HISTORY.X.eq(block.x))
.and(RPKIT_BLOCK_HISTORY.Y.eq(block.y))
.and(RPKIT_BLOCK_HISTORY.Z.eq(block.z))
.orderBy(RPKIT_BLOCK_HISTORY.ID)
.limit(1)
.fetchOne() ?: return@supplyAsync null
val id = result.get(RPKIT_BLOCK_HISTORY.ID)
return@supplyAsync if (id == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,14 +50,15 @@ class BlockBreakListener(private val plugin: RPKBlockLoggingBukkit) : Listener {
} else {
characterService?.getPreloadedActiveCharacter(minecraftProfile)
}
val oldType = event.block.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = profile,
minecraftProfile = minecraftProfile,
character = character,
from = event.block.type,
from = oldType,
to = Material.AIR,
reason = "BREAK"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,14 +38,15 @@ class BlockBurnListener(private val plugin: RPKBlockLoggingBukkit) : Listener {
plugin.logger.severe("Failed to retrieve block history service, did the plugin load correctly?")
return
}
val oldType = event.block.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = null,
minecraftProfile = null,
character = null,
from = event.block.type,
from = oldType,
to = Material.AIR,
reason = "BURN"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,15 +37,17 @@ class BlockFormListener(private val plugin: RPKBlockLoggingBukkit) : Listener {
plugin.logger.severe("Failed to retrieve block history service, did the plugin load correctly?")
return
}
val oldType = event.block.type
val newType = event.newState.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = null,
minecraftProfile = null,
character = null,
from = event.block.type,
to = event.newState.type,
from = oldType,
to = newType,
reason = "FORM"
)
plugin.server.scheduler.runTask(plugin, Runnable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,15 +37,17 @@ class BlockFromToListener(private val plugin: RPKBlockLoggingBukkit) : Listener
plugin.logger.severe("Failed to retrieve block history service, did the plugin load correctly?")
return
}
val oldType = event.toBlock.type
val newType = event.block.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = null,
minecraftProfile = null,
character = null,
from = event.toBlock.type,
to = event.block.type,
from = oldType,
to = newType,
reason = "FROM_TO"
)
plugin.server.scheduler.runTask(plugin, Runnable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,15 +46,17 @@ class BlockIgniteListener(private val plugin: RPKBlockLoggingBukkit) : Listener
val minecraftProfile = if (player == null) null else minecraftProfileService?.getPreloadedMinecraftProfile(player)
val profile = minecraftProfile?.profile as? RPKProfile
val character = if (minecraftProfile == null) null else characterService?.getPreloadedActiveCharacter(minecraftProfile)
val oldType = event.block.type
val newType = event.block.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = profile,
minecraftProfile = minecraftProfile,
character = character,
from = event.block.type,
to = event.block.type,
from = oldType,
to = newType,
reason = "IGNITE"
)
plugin.server.scheduler.runTask(plugin, Runnable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,15 +37,17 @@ class BlockPistonExtendListener(private val plugin: RPKBlockLoggingBukkit) : Lis
var block = event.block
var count = 0
while (block.type != Material.AIR && count < 12) {
val oldType = block.type
val newType = block.getRelative(event.direction.oppositeFace).type
blockHistoryService.getBlockHistory(block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = null,
minecraftProfile = null,
character = null,
from = block.type,
to = block.getRelative(event.direction.oppositeFace).type,
from = oldType,
to = newType,
reason = "PISTON"
)
plugin.server.scheduler.runTask(plugin, Runnable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,14 +33,15 @@ class BlockPistonRetractListener(private val plugin: RPKBlockLoggingBukkit) : Li
@EventHandler(priority = MONITOR)
fun onBlockPistonRetract(event: BlockPistonRetractEvent) {
val blockHistoryService = Services[RPKBlockHistoryService::class.java] ?: return
val oldType = event.block.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = null,
minecraftProfile = null,
character = null,
from = event.block.type,
from = oldType,
to = Material.AIR,
reason = "PISTON"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Ren Binden
* Copyright 2022 Ren Binden
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,15 +41,17 @@ class BlockPlaceListener(private val plugin: RPKBlockLoggingBukkit) : Listener {
val minecraftProfile = minecraftProfileService.getPreloadedMinecraftProfile(event.player)
val profile = minecraftProfile?.profile as? RPKProfile
val character = if (minecraftProfile == null) null else characterService.getPreloadedActiveCharacter(minecraftProfile)
val oldType = event.blockReplacedState.type
val newType = event.block.type
blockHistoryService.getBlockHistory(event.block.toRPKBlockLocation()).thenAccept { blockHistory ->
val blockChange = RPKBlockChangeImpl(
blockHistory = blockHistory,
time = LocalDateTime.now(),
profile = profile,
minecraftProfile = minecraftProfile,
character = character,
from = event.blockReplacedState.type,
to = event.block.type,
from = oldType,
to = newType,
reason = "PLACE"
)
plugin.server.scheduler.runTask(plugin, Runnable {
Expand Down
Loading

0 comments on commit 2d696b6

Please sign in to comment.