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

simplify #469

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
819777b
remove old compatibility versions
CJCrafter Oct 12, 2024
b0071be
remove 1.12 compatible commands
CJCrafter Oct 12, 2024
9ef2eed
remove "devMode" since no old versions are used anymore
CJCrafter Nov 19, 2024
69d4d7f
Merge branch 'refs/heads/master' into cj/simplify
CJCrafter Nov 25, 2024
bb2be0b
migrate version checking and reflection to new ReflectionUtil
CJCrafter Nov 25, 2024
9623800
start conversion to jorel's command api
CJCrafter Dec 3, 2024
ab5d33c
simplify test cases, because MockBukkit is above my pay grade
CJCrafter Dec 7, 2024
482952b
Remove all old lib files
CJCrafter Dec 7, 2024
3733485
fix list format getting an extra '<>'
CJCrafter Dec 8, 2024
217a9bb
update serializer exceptions to be a bit more concise
CJCrafter Dec 13, 2024
d6f3420
update serializers to new optional system
CJCrafter Dec 24, 2024
6b9c96a
update to gradle 8.11.1 and paperweight 2.0.0
CJCrafter Dec 24, 2024
8d1741f
update weaponmechanics serializers to new optional system
CJCrafter Dec 26, 2024
c00c70a
spotlessApply
CJCrafter Dec 26, 2024
eb65b09
convert weaponmechanics commands to jorel's command api
CJCrafter Dec 27, 2024
d3f0968
convert the rest of the weapon mechanics serializers
CJCrafter Dec 28, 2024
c16dd72
update attributes to the new system. Add support for operations
CJCrafter Jan 3, 2025
d4ad8f1
remove support for "Broken_Item"
CJCrafter Jan 3, 2025
22ba032
remove unused compatibility methods
CJCrafter Jan 3, 2025
a7163ac
switch to packetevents
CJCrafter Jan 4, 2025
fe069a2
fix bstats not being included
CJCrafter Jan 4, 2025
a533d4c
first build. Update libs, add compatibility for 1.21.4
CJCrafter Jan 4, 2025
10db148
update xseries, fix serializer typos
CJCrafter Jan 8, 2025
db4d7b9
update adventureChatAPI
CJCrafter Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 3 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ WeaponMechanics leverages the following technologies:

## New contributor guide

When cloning the repository, you will need to either:
1. Set `devMode=true` in [gradle.properties](../gradle.properties) to disable legacy versions.
2. Use [download-spigot-libs.bat](../lib/download-spigot-libs.bat) to build legacy versions.

This will allow you to compile the plugin. Make sure to reload the gradle project
after making changes to gradle files. To build the `.jar` files, run
To build the plugin for Spigot, run:
```shell
./gradlew buildForSpigotRelease
```

The `.jar` files will be located in the `build/` directory.

## Making a pull request

When making a pull request, GitHub Actions will automatically run the following
Expand Down
49 changes: 23 additions & 26 deletions BuildMechanicsCore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@ plugins {
dependencies {
implementation(project(":MechanicsCore"))
implementation(project(":CoreCompatibility"))
implementation(project(":WorldGuardV6"))
implementation(project(":WorldGuardV7"))

// Implementation for all the libraries we shade:
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.21")
implementation("net.kyori:adventure-api:${Versions.ADVENTURE_API}")
implementation("net.kyori:adventure-platform-bukkit:${Versions.ADVENTURE_BUKKIT}")
implementation("net.kyori:adventure-text-serializer-legacy:${Versions.ADVENTURE_API}")
implementation("net.kyori:adventure-text-minimessage:${Versions.ADVENTURE_API}")
implementation("com.zaxxer:HikariCP:5.1.0")
implementation("org.slf4j:slf4j-nop:1.7.30")
implementation(Dependencies.X_SERIES)
implementation(Dependencies.FOLIA_SCHEDULER)
implementation(Dependencies.COMMAND_API_SHADE)
implementation("net.bytebuddy:byte-buddy:1.15.10") // Making classes describable

// Add all compatibility modules
val devMode = findProperty("devMode") == "true"
var addedOne = false
file("../CoreCompatibility").listFiles()?.forEach {
if (it.isDirectory && it.name.matches(Regex("Core_\\d+_\\d+_R\\d+"))) {
// Use check the reobf variant for all modules 1.17+
val major = it.name.split("_")[2].toInt()

if (major >= 17) {
implementation(project(":${it.name}", "reobf"))
} else if (!devMode) {
implementation(project(":${it.name}"))
}
implementation(project(":${it.name}", "reobf"))
addedOne = true
}
}
Expand Down Expand Up @@ -55,19 +59,12 @@ tasks.shadowJar {
dependencies {
include(project(":MechanicsCore"))
include(project(":CoreCompatibility"))
include(project(":WorldGuardV6"))
include(project(":WorldGuardV7"))

// Add all compatibility modules
val devMode = findProperty("devMode") == "true"
var addedOne = false
file("../CoreCompatibility").listFiles()?.forEach {
if (it.isDirectory && it.name.matches(Regex("Core_\\d+_\\d+_R\\d+"))) {
// Filter out projects when in devMode
val major = it.name.split("_")[2].toInt()
if (devMode && major < 17)
return@forEach

include(project(":${it.name}"))
addedOne = true
}
Expand All @@ -91,20 +88,20 @@ tasks.shadowJar {
include(dependency("org.slf4j::"))
}

relocate("xyz.jpenilla", "me.deecaad.core.lib.reflection") {
include(dependency("xyz.jpenilla::"))
}

relocate("net.fabricmc", "me.deecaad.core.lib.fabric") {
include(dependency("net.fabricmc::"))
}

relocate("com.cryptomorin.xseries", "me.deecaad.core.lib.xseries") {
include(dependency("com.github.cryptomorin:XSeries:"))
}

relocate("com.cjcrafter.foliascheduler", "me.deecaad.core.lib.scheduler") {
include(dependency("com.cjcrafter:foliascheduler:"))
}

relocate("dev.jorel.commandapi", "me.deecaad.core.lib.commandapi") {
include(dependency("dev.jorel:commandapi-bukkit-shade:"))
}

relocate("net.bytebuddy", "me.deecaad.core.lib.bytebuddy") {
include(dependency("net.bytebuddy::"))
}
}
}
}
27 changes: 10 additions & 17 deletions BuildWeaponMechanics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ plugins {
dependencies {
implementation(project(":WeaponMechanics"))

// Implementation for all the libraries we shade:
implementation(Dependencies.BSTATS)
implementation("com.jeff_media:SpigotUpdateChecker:3.0.3")
implementation(Dependencies.GSON)

// Add all compatibility modules
val devMode = findProperty("devMode") == "true"
var addedOne = false
file("../WeaponCompatibility").listFiles()?.forEach {
if (it.isDirectory && it.name.matches(Regex("Weapon_\\d+_\\d+_R\\d+"))) {
// Use the reobf variant for all modules 1.17+
val major = it.name.split("_")[2].toInt()

if (major >= 17) {
implementation(project(":${it.name}", "reobf"))
} else if (!devMode) {
implementation(project(":${it.name}"))
}
implementation(project(":${it.name}", "reobf"))
addedOne = true
}
}
Expand All @@ -41,7 +38,7 @@ bukkit {
foliaSupported = true

authors = listOf("DeeCaaD", "CJCrafter")
depend = listOf("ProtocolLib")
depend = listOf("packetevents")
softDepend = listOf("MechanicsCore", "MythicMobs", "CrackShot", "CrackShotPlus", "VivecraftSpigot")

permissions {
Expand All @@ -61,15 +58,9 @@ tasks.shadowJar {
dependencies {
include(project(":WeaponMechanics"))

val devMode = findProperty("devMode") == "true"
var addedOne = false
file("../WeaponCompatibility").listFiles()?.forEach {
if (it.isDirectory && it.name.matches(Regex("Weapon_\\d+_\\d+_R\\d+"))) {
// Filter out projects when in devMode
val major = it.name.split("_")[2].toInt()
if (devMode && major < 17)
return@forEach

include(project(":${it.name}"))
addedOne = true
}
Expand All @@ -91,7 +82,9 @@ tasks.shadowJar {

// This doesn't actually include any dependencies, this relocates all references
// to the mechanics core lib.
relocate("kotlin.", "me.deecaad.core.lib.kotlin.")
relocate("net.kyori", "me.deecaad.core.lib")
relocate("kotlin.", "me.deecaad.weaponmechanics.lib.kotlin.")
relocate("com.cryptomorin.xseries", "me.deecaad.core.lib.xseries")
relocate("com.cjcrafter.foliascheduler", "me.deecaad.core.lib.scheduler")
relocate("dev.jorel.commandapi", "me.deecaad.core.lib.commandapi")
}
9 changes: 0 additions & 9 deletions CoreCompatibility/Core_1_12_R1/build.gradle.kts

This file was deleted.

This file was deleted.

Loading