Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-87 Finish sending logic #91

Merged
merged 84 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
de158d5
Add ItemStorage logic
Jakubk15 Nov 3, 2023
cef9cc9
Change default database type to SQLITE
Rollczi Nov 15, 2023
e7a11f9
GH-89 Update lite commands version and all commands
CitralFlo Nov 19, 2023
13cf46a
Merge branch 'master' into finish-sending-logic
Rollczi Nov 25, 2023
5f8d260
Update item handling in Parcel GUI and make other code improvements. …
Rollczi Nov 25, 2023
d036183
Update item handling in Parcel GUI and make other code improvements. …
Rollczi Nov 25, 2023
dd40bf0
Bump litecommands
Rollczi Nov 25, 2023
6eb6561
Bump litecommands
Rollczi Nov 26, 2023
cdf0cc1
Add configurable options for selected size packages in SendingGUI.
CitralFlo Nov 26, 2023
3cfb777
Add ItemStorage logic
Jakubk15 Nov 26, 2023
00bac5a
Simplify available commands, in future LC update add optional aliases…
CitralFlo Nov 26, 2023
602c5ee
Merge remote-tracking branch 'origin/finish-sending-logic' into finis…
CitralFlo Nov 26, 2023
190bcc1
(WIP) Add InventoryUtil and GsonItemSerializer
Jakubk15 Nov 26, 2023
df98153
Try Base64 ItemStack serialization (WIP)
Jakubk15 Dec 5, 2023
9664504
Fix JSON serialization
Jakubk15 Dec 17, 2023
b5fa968
Remove parseStringList method
Jakubk15 Dec 17, 2023
fd986f3
Fix serialization (WIP)
Jakubk15 Dec 17, 2023
2fd9b9e
Add illegal items (Closes #70)
Jakubk15 Dec 17, 2023
4f490cb
Merge branch 'master' into finish-sending-logic
Jakubk15 Dec 23, 2023
021fcea
Update README.md
Jakubk15 Dec 23, 2023
99bdd93
Add priority item selector, beautify the selected items lore
Jakubk15 Dec 23, 2023
45605de
Remove cancel button, optimize database methods, and many more...
Jakubk15 Dec 23, 2023
9323b9f
Fix build
Jakubk15 Dec 23, 2023
548775d
Fix ParcelListGUI and refactor code
Jakubk15 Jan 13, 2024
8528ef6
Merge branch 'master' into finish-sending-logic
Jakubk15 Jan 22, 2024
be0508d
Fix parcel item storage GUI size
Jakubk15 Jan 22, 2024
450a05c
Code-only changes
Jakubk15 Jan 27, 2024
d5c85f2
Code-only changes, register LockerArgument
Jakubk15 Feb 3, 2024
684b038
Add parcel submit button, fix UUID filtering
Jakubk15 Feb 4, 2024
a2c5d98
Refactor GUI packages
Jakubk15 Feb 7, 2024
f42e36d
Remove unused arguments. Add User domain. Use interface where possibl…
Jakubk15 Feb 18, 2024
0223302
Merge branch 'master' into finish-sending-logic
Jakubk15 Mar 23, 2024
06acc0b
Remove unnecessary TODO tasks. Start beautifying the PluginConfiguration
Jakubk15 Mar 23, 2024
a9860c4
Initialize UserRepository table, add fancy symbols to PluginConfigura…
Jakubk15 Mar 23, 2024
128e0f8
Fix typo in PluginConfiguration
Jakubk15 Mar 23, 2024
a64900d
Rearrange and cleanup code in PluginConfiguration
Jakubk15 Mar 23, 2024
af03a94
Start working on introducing user-parcel tables
Jakubk15 Mar 23, 2024
99bceae
Make UserRepositoryImpl less cache-dependent, fix placeholder replace…
Jakubk15 Apr 28, 2024
29d8ebc
Huge README.md revamp
Jakubk15 Jun 15, 2024
10cbe5b
Bump gradle and certain dependencies
Jakubk15 Jun 15, 2024
ae66564
Update gradle.yml
Jakubk15 Jun 15, 2024
24dfed9
Minor README touchups
Jakubk15 Jun 15, 2024
be93f43
Update CODEOWNERS
Jakubk15 Jun 15, 2024
2dad8ab
Merge branch 'refs/heads/master' into finish-sending-logic
Jakubk15 Jun 27, 2024
3b09650
Java 21 and MC 1.21 support, add ParcelContent object and its subclas…
Jakubk15 Jun 28, 2024
d97f4ad
Prepare for Java 21, update config. Refactor code, update GUIs. Adjus…
Jakubk15 Jun 29, 2024
a964f33
Add more GUIs
Jakubk15 Jun 29, 2024
52eace4
Receiver selection logic (WIP), fix SignAPI shading. Add more utility…
Jakubk15 Jun 29, 2024
a4735db
Rename config entry, use method references
Jakubk15 Jul 1, 2024
e2a175f
Refactor exception handling, better gui refreshing (WIP). Fix SkullAP…
Jakubk15 Jul 1, 2024
4425f23
Use type parameter in GuiRefresher. Change field name, create toItem(…
Jakubk15 Jul 3, 2024
43bd74a
Move duplicate methods to ItemUtil class.
Jakubk15 Jul 7, 2024
e915e6b
Merge branch 'refs/heads/master' into finish-sending-logic
Jakubk15 Jul 7, 2024
05206b9
Fix ConcurrentModificationException
Jakubk15 Jul 7, 2024
e9b766e
Revert GuiRefresher to previous state and rename it to PaginatedGuiRe…
Jakubk15 Jul 7, 2024
6239d4f
Add "this" keywords
Jakubk15 Jul 7, 2024
f4832c0
Reformat code
Jakubk15 Jul 7, 2024
e67506f
Adjust codestyle
Jakubk15 Jul 7, 2024
209ff09
Use ExceptionHandler class, replace whenComplete with thenAccept
Jakubk15 Jul 7, 2024
7e196b3
Fix receiver GUI selector.
Jakubk15 Jul 21, 2024
c0e421a
MC 1.21 in runPaper, fix lore override bug, fix ArrayIndexOutOfBounds…
Jakubk15 Jul 24, 2024
89cc5f6
Merge branch 'master' into finish-sending-logic
Jakubk15 Jul 24, 2024
2c0b35c
Use ParcelSendingGUIState to store parcel properties such as name, de…
Jakubk15 Jul 24, 2024
39756de
Move close gui action to bottom
Jakubk15 Jul 24, 2024
5548d69
WIP: Destination locker selection GUI
Jakubk15 Aug 7, 2024
b8cf77f
Make ConfigItem Cloneable, fix GUI stuff
Jakubk15 Aug 29, 2024
886525a
Merge branch 'master' into finish-sending-logic
Jakubk15 Aug 29, 2024
0e2ea7e
Use states instead of fields where possible.
Jakubk15 Aug 29, 2024
54de007
Code cleanup
Jakubk15 Aug 29, 2024
157dfb3
Fix build
Jakubk15 Aug 29, 2024
09e6c4a
Fix build
Jakubk15 Aug 31, 2024
faba100
Update README.md
Jakubk15 Aug 31, 2024
a1c69bb
Update README.md
Jakubk15 Aug 31, 2024
c0e3ab4
Update README.md
Jakubk15 Aug 31, 2024
a81d4f8
Update src/main/java/com/eternalcode/parcellockers/gui/implementation…
Jakubk15 Aug 31, 2024
e3daa50
Update src/main/java/com/eternalcode/parcellockers/gui/implementation…
Jakubk15 Aug 31, 2024
b54c269
Update build.gradle.kts
Jakubk15 Aug 31, 2024
a416d72
Apply review suggestions
Jakubk15 Sep 6, 2024
36d5225
Merge remote-tracking branch 'origin/finish-sending-logic' into finis…
Jakubk15 Sep 6, 2024
7197215
Cleanup DestinationSelectionGUI#toItem
Rollczi Sep 8, 2024
e09dfe4
Don't mutate lore in config item.
Rollczi Sep 8, 2024
9abd2bc
Cleanup lore
Rollczi Sep 8, 2024
963b119
Use #clone on ConfigItems and add config message to illegal items
Jakubk15 Sep 14, 2024
7c73da7
Merge remote-tracking branch 'origin/finish-sending-logic' into finis…
Jakubk15 Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @EternalCodeTeam/eternalcodeteam-maintainers @Jakubk15
* @EternalCodeTeam/team @Jakubk15
Jakubk15 marked this conversation as resolved.
Show resolved Hide resolved
106 changes: 61 additions & 45 deletions README.md
Jakubk15 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,84 +1,89 @@
# ParcelLockers

### ParcelLockers is a user plugin, dedicated for Spigot-based servers.

<div align="center">

![ParcelLockers.svg](assets/ParcelLockers.svg)

[![Supports Paper](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/supported/paper_vector.svg)](https://papermc.io)
[![Supports Spigot](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/supported/spigot_vector.svg)](https://spigotmc.org)

[![Patreon](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/donate/patreon-plural_vector.svg)](https://www.patreon.com/eternalcode)
[![Website](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/documentation/website_vector.svg)](https://eternalcode.pl/)
[![Discord](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/social/discord-plural_vector.svg)](https://discord.gg/FQ7jmGBd6c)
[![Chat on Discord](https://raw.githubusercontent.com/vLuckyyy/badges/main//chat-with-us-on-discord.svg)](https://discord.com/invite/FQ7jmGBd6c)

[![Gradle](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/built-with/gradle_vector.svg)](https://gradle.org/)
[![Java](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/built-with/java17_vector.svg)](https://www.java.com/)

</div>

# Warning ❗
# Welcome to ParcelLockers! 🚀

ParcelLockers is a minecraft plugin, dedicated for Spigot-based servers.. 💎 Crafted with care, ParcelLockers
is dedicated to incorporating highly practical server function of transfering items across the Minecraft world,
especially on long distances.

## ℹ️ Information

- ParcelLockers fully supports Minecraft's latest minor versions starting from each major version, starting from 1.17
onward, e.g. `1.17.1`, `1.18.2`, `1.19.4`, `1.20.6`, `1.21.1`.
- Requires **Java 17 or later** to work properly. For older versions of Java, this may affect the functionality of the
plugin.
- If you have any questions, you can ask us about it on our [Discord server](https://discord.gg/FQ7jmGBd6c).

## ❗Warning

ParcelLockers is at an very early stage of development, and you use it at your own risk.

# Building
## 🏗️ Compiling JAR from Source

To build ParcelLockers, follow these steps (Make sure you have **JDK 21 or higher**):

To build ParcelLockers execute this command using Gradle (Make sure you are using JDK 8 for maximum compatibility)
```shell
./gradlew clean shadowJar
```

`./gradlew clean shadowJar`
- The output file will be located at `build/libs`.
- When you build the plugin for the first time, it might take a while to download all the dependencies.

When you build it for the first time, it may take a little longer.
## 🛠️ Development builds

# Development builds
🤫 Want to be a few steps ahead of others? You can gather our freshly squeezed builds from GitHub
Actions [here](https://github.com/EternalCodeTeam/ParcelLockers/actions).

You can gather the development builds from [GitHub Actions](https://github.com/EternalCodeTeam/ParcelLockers/actions)
## :octocat: Contributing

# Contributing
🧩 Are you a developer and want to add something?

Create a [public fork of the repository](https://github.com/EternalCodeTeam/ParcelLockers/fork), modify it with
appropriate
changes and then create a Pull Request.
See [CONTRIBUTING.md](https://github.com/EternalCodeTeam/ParcelLockers/blob/master/.github/CONTRIBUTING.md) to find out
more.

## TODO
- [ ] Add support for more databases (H2, PostgreSQL, MongoDB?)
- [ ] Add translation system, more languages
- [ ] Add delivery codes, so any person knowing the code can pick up the parcel
- [ ] Add delivery time, so the parcel can be picked up only in a specific time
- [ ] Parcel permissions for user
- [ ] Parcel return logic
- [ ] Banned parcel items (configurable)
- [ ] Parcel fee
- [ ] Rewrite database to ORMLite (far in future)
- [x] Add "business" logic
- [ ] Add more parcel types (fragile, etc...)
- [ ] Add option to config for parcel locker space (e.g. max parcels within a locker)
- [x] Rewrite Position class to use Integers instead of Doubles
- [ ] Finish GUIs
- [ ] Add more GUIs (admin GUI, parcel create GUI, etc.)
- [ ] Add Discord integration (bot, webhooks, etc...)
- [ ] Add more commands
- [x] Isolate cache into separate classes
- [x] Extract database service methods into repositories (interfaces)
- [x] Delete cyclic dependency (Parcel <-> ParcelLocker), switch to UUID instead of object references

# License

#### ParcelLockers is published under the GNU GPL-v3 license. In particular, the developer:
## 🐛 Issues

Found a bug? Report it [here](https://github.com/EternalCodeTeam/ParcelLockers/issues). If you are not sure if that's an
intended behavior or not, feel free to ask on our [Discord](https://discord.com/invite/FQ7jmGBd6c) 😅

Additionally, if you enable automatic Sentry bug
reporting in your config.yml file (we strongly advise to do so), errors will be automatically sent to us, which will
greatly accelerate the bug fixing process 🥳

## 📜 License

### ParcelLockers is published under the GNU GPL-v3 license. In particular, the developer:

- Is freely allowed to modify and improve the code
- Can distribute production versions
- He must publish any changes made, ie. the public fork of this repository
- Cannot change the license or copyright

#### Additionally:
### Additionally:

- It is forbidden to modify or remove the code responsible for the compliance of production versions with the license.
- The authors of this project are not responsible for using the application, modifying and distributing it.
- Trademarks appearing in this project and this document belong to their rightful owners and are used for informational
purposes only.

# Other dependencies usages
## ❤️ Other dependencies usages

- [LiteCommands (by Rollczi ❤️)](https://github.com/Rollczi/LiteCommands)
- [Adventure API & MiniMessage](https://docs.adventure.kyori.net/)
Expand All @@ -88,13 +93,24 @@ more.
- [Spigot API](https://www.spigotmc.org/wiki/spigot-maven/#build-gradle)
- [expressible](https://github.com/dzikoysk/expressible)
- [panda-utilities](https://github.com/panda-lang/panda)
- [Errorprone](https://github.com/google/error-prone)
- [TriumphGUI](https://github.com/TriumphTeam/triumph-gui)
- [bStats](https://bstats.org/)
- [jackson-bukkit](https://github.com/eldoriarpg/jackson-bukkit)
Jakubk15 marked this conversation as resolved.
Show resolved Hide resolved
- [SignGUI](https://github.com/Rapha149/SignGUI)

## :heart: Special Thanks

[<img src="https://user-images.githubusercontent.com/65517973/210912946-447a6b9a-2685-4796-9482-a44bffc727ce.png" alt="JetBrains" width="150">](https://www.jetbrains.com)
![sentry.svg](assets/sentry.svg)

We express our gratitude to JetBrains for providing [Open Source Licenses](https://www.jetbrains.com/opensource/) for
their outstanding tools. We recommend using [IntelliJ IDEA](https://www.jetbrains.com/idea/) to work with our projects
and boost your productivity!

ParcelLockers is a advanced user delivery plugin, dedicated for Spigot-based servers.
We also thank [Sentry](https://sentry.io) for providing us with
a [Open-Source Sponsorship plan](https://sentry.io/for/open-source/) for error tracking. We recommend using
[Sentry](https://sentry.io) to track
errors in
your projects and improve the quality of your software.

🚫 Found an issue? Report it [here](https://github.com/EternalCodeTeam/ParcelLockers/issues).

🧩 Are you a developer and want to add something? Feel free
to [create a pull request](https://github.com/EternalCodeTeam/ParcelLockers/pulls).
17 changes: 17 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## 📝 TODO

- [ ] Add support for more databases (H2, PostgreSQL, MongoDB?)
- [ ] Add translation system, more languages
- [ ] Add delivery codes, so any person knowing the code can pick up the parcel
- [ ] Add delivery time, so the parcel can be picked up only in a specific time
- [ ] Parcel permissions for user
- [ ] Parcel return logic
- [x] Banned parcel items (configurable)
- [ ] Parcel fee
- [ ] Rewrite database to ORMLite (far in future)
- [ ] Add more parcel types (fragile, etc...)
- [ ] Add option to config for parcel locker space (e.g. max parcels within a locker)
- [ ] Finish GUIs
- [ ] Add more GUIs (admin GUI, parcel create GUI, etc.)
- [ ] Add Discord integration (bot, webhooks, etc...)
- [ ] Add more commands
44 changes: 44 additions & 0 deletions assets/ParcelLockers.svg
Jakubk15 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/sentry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 25 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
checkstyle
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
id("xyz.jpenilla.run-paper") version "2.3.1"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.gradleup.shadow") version "8.3.0"
}

group = "com.eternalcode"
Expand All @@ -22,14 +22,16 @@ repositories {
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
maven { url = uri("https://repo.eternalcode.pl/releases") }
maven { url = uri("https://repository.minecodes.pl/releases") }
maven { url = uri("https://jitpack.io") }
}

dependencies {
// minecraft development api
compileOnly("org.spigotmc:spigot-api:1.20.5-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT")
implementation("net.kyori:adventure-platform-bukkit:4.3.4")
implementation("net.kyori:adventure-text-minimessage:4.17.0")
implementation("dev.rollczi.litecommands:bukkit-adventure:2.8.9")
implementation("dev.rollczi:litecommands-bukkit:3.1.0")
implementation("dev.rollczi:litecommands-adventure:3.1.0")

// skull api
implementation("dev.rollczi:liteskullapi:1.3.0")
Expand Down Expand Up @@ -66,9 +68,18 @@ dependencies {
// paperlib
implementation("io.papermc:paperlib:1.0.8")

// signgui
implementation("de.rapha149.signgui:signgui:2.4.1")

// panda-utilities
implementation("org.panda-lang:panda-utilities:0.5.2-alpha")

// jackson-bukkit
implementation("de.eldoria.jacksonbukkit:paper:1.2.0")

// completable-futures
implementation("com.spotify:completable-futures:0.3.6")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.0")
Expand All @@ -79,7 +90,7 @@ dependencies {
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

checkstyle {
Expand All @@ -95,31 +106,32 @@ bukkit {
main = "com.eternalcode.parcellockers.ParcelLockers"
apiVersion = "1.13"
prefix = "ParcelLockers"
author = "Jakubk15"
author = "EternalCodeTeam"
name = "ParcelLockers"
description =
"Plugin that provides functionality of parcel lockers in Minecraft, allowing players to send and receive parcels safely."
website = "https://github.com/EternalCodeTeam/ParcelLockers"
version = "1.0.0-SNAPSHOT"
depend = listOf("Vault")
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.setIncremental(true)
options.compilerArgs.add("-parameters")
options.release = 17
}

tasks {
runServer {
minecraftVersion("1.20.2")
minecraftVersion("1.21.1")
}

test {
useJUnitPlatform()
}

shadowJar {
archiveFileName.set("ParcelLockers v${project.version} (MC 1.8.8-1.20.x).jar")
archiveFileName.set("ParcelLockers v${project.version} (MC 1.8.8-1.21.x).jar")

exclude(
"org/intellij/lang/annotations/**",
Expand All @@ -129,7 +141,9 @@ tasks {
)

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

val prefix = "com.eternalcode.parcellockers.libs"
listOf(
Expand All @@ -141,7 +155,8 @@ tasks {
"dev.rollczi",
"net.kyori",
"org.json",
"com.fasterxml"
"com.fasterxml",
"de.rapha149"
).forEach { relocate(it, prefix) }
}
}
Loading