Skip to content

Commit 7ee714f

Browse files
Jakubk15coderabbitai[bot]imDMK
authored
GH-110 Add parcel receiving logic
* Remove recipients field from Parcel object. Convert GuiView to interface * Create ParcelCollectionGui. Simplify unit test. Add more config entries. * Remove builder() method from Parcel * Fix test * Exclude gson from relocation. Enable auto-relocation * Move checkstyle config to gradle/ * Rename ExceptionHandler to SentryExceptionHandler * Add ParcelManager#collectParcel method * Fix relocation. Add Blossom replacement tokens * Update src/main/java/com/eternalcode/parcellockers/gui/implementation/locker/ParcelCollectionGui.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Remove checkstyle * Implement removeAll() methods. Add DebugCommand. Fix ParcelCollectionGui * Implement parcel collection logic, minor code improvements * Improve pagination logic * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update src/main/java/com/eternalcode/parcellockers/gui/implementation/locker/ParcelCollectionGui.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Unify repository method naming * Fix build. Improve run-task tasks * Fix CompletionException. Improve DebugCommand * apply coderabbit suggestion * Fix items shift. Give items synchronously. migrate to commons ItemUtil instead of InventoryUtil * remove todo * Correct version in gradle * Update src/main/java/com/eternalcode/parcellockers/parcel/ParcelManager.java Co-authored-by: DMK <[email protected]> * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: DMK <[email protected]> * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: DMK <[email protected]> * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: DMK <[email protected]> * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: DMK <[email protected]> * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: DMK <[email protected]> * Update src/main/java/com/eternalcode/parcellockers/command/debug/DebugCommand.java Co-authored-by: DMK <[email protected]> * Reformat code, do not use * imports * Import necessary classes * Do not create instance of ParcelCollectionGui every time. * Update src/main/java/com/eternalcode/parcellockers/configuration/implementation/ConfigItem.java Co-authored-by: DMK <[email protected]> * Fix spacing per DMK suggestion. * add empty parcel check * remove redundant Optional#ifPresent check * revert shadow version * fix build * delete unused ParcelStatus class --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: DMK <[email protected]>
1 parent 4c816c1 commit 7ee714f

File tree

51 files changed

+629
-569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+629
-569
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ greatly accelerate the bug fixing process 🥳
8484
- [SignGUI](https://github.com/Rapha149/SignGUI)
8585

8686
## :heart: Special Thanks
87+
8788
[<img src="https://user-images.githubusercontent.com/65517973/210912946-447a6b9a-2685-4796-9482-a44bffc727ce.png" alt="JetBrains" width="150">](https://www.jetbrains.com)
8889
[<img src=".github/assets/sentry.svg" alt="Sentry logo" width="150" height="150">](https://www.sentry.io)
8990

build.gradle.kts

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import xyz.jpenilla.runtask.task.AbstractRun
2+
13
plugins {
24
`java-library`
3-
checkstyle
45
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
56
id("xyz.jpenilla.run-paper") version "2.3.1"
6-
id("com.gradleup.shadow") version "8.3.5"
7+
id("com.gradleup.shadow") version "8.3.6"
78
}
89

910
group = "com.eternalcode"
10-
version = "1.0.0-SNAPSHOT"
11-
description =
12-
"Plugin that provides functionality of parcel lockers in Minecraft, allowing players to send and receive parcels safely."
11+
version = "0.0.1-SNAPSHOT"
12+
description = "Plugin that provides functionality of parcel lockers in Minecraft, allowing players to send and receive parcels safely."
1313

1414
repositories {
1515
gradlePluginPortal()
@@ -36,8 +36,9 @@ dependencies {
3636
// skull api
3737
implementation("dev.rollczi:liteskullapi:1.3.0")
3838

39-
// gui library
39+
// gui
4040
implementation("dev.triumphteam:triumph-gui:3.1.11")
41+
implementation("de.rapha149.signgui:signgui:2.5.0")
4142

4243
// economy
4344
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
@@ -71,9 +72,6 @@ dependencies {
7172
// paperlib
7273
implementation("io.papermc:paperlib:1.0.8")
7374

74-
// signgui
75-
implementation("de.rapha149.signgui:signgui:2.5.0")
76-
7775
// panda-utilities
7876
implementation("org.panda-lang:panda-utilities:0.5.2-alpha")
7977

@@ -84,8 +82,8 @@ dependencies {
8482
implementation("com.spotify:completable-futures:0.3.6")
8583

8684
// eternalcode-commons
87-
implementation("com.eternalcode:eternalcode-commons-adventure:1.1.5")
88-
implementation("com.eternalcode:eternalcode-commons-bukkit:1.1.5")
85+
implementation("com.eternalcode:eternalcode-commons-adventure:1.1.6")
86+
implementation("com.eternalcode:eternalcode-commons-bukkit:1.1.6")
8987

9088
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
9189
testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.4")
@@ -100,25 +98,15 @@ java {
10098
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
10199
}
102100

103-
checkstyle {
104-
toolVersion = "10.21.1"
105-
106-
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
107-
108-
maxErrors = 0
109-
maxWarnings = 0
110-
}
111-
112101
bukkit {
113102
main = "com.eternalcode.parcellockers.ParcelLockers"
114103
apiVersion = "1.13"
115104
prefix = "ParcelLockers"
116105
author = "EternalCodeTeam"
117106
name = "ParcelLockers"
118-
description =
119-
"Plugin that provides functionality of parcel lockers in Minecraft, allowing players to send and receive parcels safely."
107+
description = project.description
120108
website = "https://github.com/EternalCodeTeam/ParcelLockers"
121-
version = "1.0.0-SNAPSHOT"
109+
version = project.version.toString()
122110
}
123111

124112
tasks.withType<JavaCompile> {
@@ -128,11 +116,33 @@ tasks.withType<JavaCompile> {
128116
options.release = 21
129117
}
130118

119+
tasks.withType(AbstractRun::class) {
120+
javaLauncher = javaToolchains.launcherFor {
121+
vendor = JvmVendorSpec.JETBRAINS
122+
languageVersion = JavaLanguageVersion.of(21)
123+
}
124+
jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods")
125+
}
126+
131127
tasks {
132128
runServer {
133129
minecraftVersion("1.21.4")
134130
}
135131

132+
cleanPaperPluginsCache {
133+
doLast {
134+
project.file("run/plugins").deleteRecursively()
135+
}
136+
}
137+
138+
cleanPaperCache {
139+
doLast {
140+
project.file("run/cache").deleteRecursively()
141+
project.file("run/logs").deleteRecursively()
142+
project.file("run/versions").deleteRecursively()
143+
}
144+
}
145+
136146
test {
137147
useJUnitPlatform()
138148
}
@@ -145,25 +155,38 @@ tasks {
145155
"org/jetbrains/annotations/**",
146156
"META-INF/**",
147157
"javax/**",
158+
"javassist/**",
159+
"org/h2/util/**"
148160
)
149161

150162
mergeServiceFiles()
151163
minimize {
152164
exclude(dependency("de\\.rapha149\\.signgui:signgui:.*")) // https://github.com/Rapha149/SignGUI/issues/15
153165
}
154166

155-
val prefix = "com.eternalcode.parcellockers.libs"
167+
val relocationPrefix = "com.eternalcode.parcellockers.libs"
156168
listOf(
157169
"panda",
158-
"org.panda_lang",
159-
"net.dzikoysk",
160-
"io.papermc.lib",
161170
"org.bstats",
162-
"dev.rollczi",
163-
"net.kyori",
164171
"org.json",
172+
"org.postgresql",
173+
"net.dzikoysk",
174+
"net.kyori",
175+
"io.papermc",
176+
"io.sentry",
177+
"dev.rollczi",
178+
"de.eldoria",
179+
"com.eternalcode.commons",
180+
"com.eternalcode.gitcheck",
165181
"com.fasterxml",
166-
"de.rapha149"
167-
).forEach { relocate(it, prefix) }
182+
"com.j256",
183+
"com.spotify",
184+
"com.zaxxer",
185+
"de.rapha149",
186+
"dev.triumphteam"
187+
).forEach { relocate(it, "$relocationPrefix.$it") }
168188
}
169189
}
190+
191+
192+

config/checkstyle/checkstyle.xml

Lines changed: 0 additions & 217 deletions
This file was deleted.

config/checkstyle/suppressions.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)