Files
bnstoolkit/build.gradle
T
Matt 665c1a8442
Build / build (push) Has been cancelled
0.8.0: JSON plot config + FTB Teams/Chunks integration
Plot system migrated from static Java + KubeJS to a runtime
configurable, FTB-Chunks-integrated system.

* Plot definitions now live in JSON at
  <world>/serverconfig/bnstoolkit/plots.json. Default file written on
  first server start with the three v0.33 plots. Editable in-place
  + reloadable via /bns admin plot reload.

* New static Plot.REGISTRY replaces Plot.ALL. Loaded on ServerStartedEvent.
  Plot.all() returns the current snapshot.

* New FtbBridge.java — compileOnly deps on ftb-teams + ftb-chunks
  (always in the pack). Wraps team lookup, chunk claim/unclaim, and
  the BEFORE_UNCLAIM event.

* /bns admin spawn-init creates the Spawn (cyan) + Plots (gold) server
  teams using configured UUIDs/colors and claims every defined plot
  for the Plots team. Idempotent.

* /bns admin plot define <id> <name> <price> — adds the chunk you're
  standing in to the plot. Re-run with the same id (different chunks)
  to make multi-chunk plots. Auto-claims for the Plots team and
  persists to JSON.

* /bns admin plot list / remove / reload commands.

* /bns plot buy <id> — pays via NumismaticsBridge.spend (cash+bank
  combined), unclaims chunks from Plots team, claims for the buyer's
  personal FTB Teams team. Records ownership in server NBT and the
  player's bnsOwnedPlots list.

* /bns plot release <id> — reverse flow, refunds 50% to bank.

* Plot chunk guard: ClaimedChunkEvent.BEFORE_UNCLAIM subscriber rejects
  any unclaim of a registered plot chunk unless a thread-local
  SYSTEM_UNCLAIMING flag is set (only set during the release/transfer
  flows). Players who try to unclaim via the FTB Chunks UI get a chat
  message redirecting them to /bns plot release.

* KubeJS plots.js retired (.retired suffix kept). All logic now in
  Java; KubeJS no longer participates in plot ownership state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 17:52:31 +00:00

137 lines
3.6 KiB
Groovy

plugins {
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.141'
id 'idea'
}
tasks.named('wrapper', Wrapper).configure {
distributionType = Wrapper.DistributionType.BIN
}
version = mod_version
group = mod_group_id
sourceSets.main.resources {
srcDir('src/generated/resources')
exclude("**/*.bbmodel")
exclude("src/generated/**/.cache")
}
repositories {
maven {
name = 'FTB'
url = 'https://maven.ftb.dev/releases'
content { includeGroup 'dev.ftb.mods' }
}
// Architectury (transitive of FTB Library)
maven {
name = 'Architectury'
url = 'https://maven.architectury.dev/'
content { includeGroup 'dev.architectury' }
}
}
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
neoForge {
version = project.neo_version
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
runs {
client {
client()
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
server {
server()
programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
data {
data()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
configurations {
runtimeClasspath.extendsFrom localRuntime
}
dependencies {
// FTB Library: Panel/Widget/Button framework for screens.
compileOnly "dev.ftb.mods:ftb-library-neoforge:2101.1.31"
// FTB Teams: server-team creation + lookup (Spawn + Plots admin teams).
compileOnly "dev.ftb.mods:ftb-teams-neoforge:2101.1.9"
// FTB Chunks: programmatic claim/unclaim + BEFORE_UNCLAIM event (plot guard).
compileOnly "dev.ftb.mods:ftb-chunks-neoforge:2101.1.14"
// Numismatics + KubeJS are accessed reflectively (NumismaticsBridge,
// ServerEconomyBridge) so they don't need compileOnly deps.
}
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
sourceSets.main.resources.srcDir generateModMetadata
neoForge.ideSyncTask generateModMetadata
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}