From 49a4e29ee58e165cae8114e5ca8a8354542a5c60 Mon Sep 17 00:00:00 2001 From: Trilleo Date: Sun, 4 Oct 2026 10:33:48 +0800 Subject: [PATCH 1/4] Feature: Add support for new features in Towny v0.103.2.10 --- CHANGELOG.md | 26 +++++++++++++++++ CLAUDE.md | 14 +++++----- README.md | 10 +++---- docs/UTILITY_GUIDE.md | 1 + gradle.properties | 2 +- .../mc/plugins/townymenu/guis/PricesMenu.kt | 2 ++ .../townymenu/guis/admin/AdminWorldMenu.kt | 28 +++++++++++++++++-- .../townymenu/guis/town/OutpostsMenu.kt | 22 +++++++++++---- .../townymenu/guis/town/TownClaimsMenu.kt | 1 + .../townymenu/guis/town/TownInfoMenu.kt | 12 ++++++++ .../townymenu/guis/tutorial/Tutorial.kt | 5 +++- .../mc/plugins/townymenu/utils/Prices.kt | 3 ++ src/main/resources/lang/en_US.yml | 12 +++++++- src/main/resources/lang/zh_CN.yml | 12 +++++++- 14 files changed, 127 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c9cc2e..dbb02a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,32 @@ ## Unreleased +### New Features + +#### Town Menu + ++ A town's page has a new Outposts button that lists where its outposts are, for players with Towny's new + `towny.command.town.outpost.list.other` permission. Your own town's outposts still teleport you when clicked. + +#### Admin Menus + ++ Each world's settings have a new Minimum Adjacent Claims button, which sets how many of a town's own chunks a new + claim in that world must touch (Towny's new `/townyworld set minadjacency`). + +### Improvements + +#### Town Menu + ++ The Cede This Plot button shows what ceding costs when the server charges for it (Towny's new + `price_town_cede` setting), and so do the Prices menu and the Ceding Land lesson. + +### Technical Details + +#### Misc + ++ TownyMenu now needs Towny 0.103.2.10 or newer, which fixes towns' home blocks and war settings not loading. The new + `Prices.cede` gives the cost of ceding a plot. + ## Version 1.1.1 ### New Features diff --git a/CLAUDE.md b/CLAUDE.md index d7a85f5..edba536 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,13 +9,13 @@ player-facing overview. ## Tech Stack -| Tool | Version | -|:---------------|:-------------------------------------------------| -| Language | Kotlin 2.3.10 | -| Build | Gradle 9.7.1 (Kotlin DSL) | -| Platform | Paper API 26.3 (MC 26.3) | -| Towny | 0.103.2.7 (`towny_version` in gradle.properties) | -| Java toolchain | JDK 25 | +| Tool | Version | +|:---------------|:--------------------------------------------------| +| Language | Kotlin 2.3.10 | +| Build | Gradle 9.7.1 (Kotlin DSL) | +| Platform | Paper API 26.3 (MC 26.3) | +| Towny | 0.103.2.10 (`towny_version` in gradle.properties) | +| Java toolchain | JDK 25 | ## After Every Change: Keep the Changelog and Docs in Sync diff --git a/README.md b/README.md index 971fe6c..16eea81 100644 --- a/README.md +++ b/README.md @@ -59,11 +59,11 @@ ## Requirements -| Dependency | Version | -|:-----------|:-----------| -| Paper | 26.3+ | -| Java | 25+ | -| Towny | 0.103.2.7+ | +| Dependency | Version | +|:-----------|:------------| +| Paper | 26.3+ | +| Java | 25+ | +| Towny | 0.103.2.10+ | TownyMenu is an addon: Towny must be installed on the server, or TownyMenu will not load. diff --git a/docs/UTILITY_GUIDE.md b/docs/UTILITY_GUIDE.md index 601734d..c683381 100644 --- a/docs/UTILITY_GUIDE.md +++ b/docs/UTILITY_GUIDE.md @@ -153,6 +153,7 @@ actually take, and everything returns `0` without an economy. |:-----------------------------------|:----------------------------------------------------------------------------------| | `claim(Town, count)` | What claiming `count` chunks costs the town, at its current rising claim price | | `outpost()` | What claiming an outpost costs | +| `cede()` | What giving a chunk to another town with `/town cede plot` costs the giving town | | `unclaimRefund()` | What a town gets back per unclaimed chunk; negative when unclaiming costs instead | | `plotType(String, count)` | What setting `count` plots to a plot type costs (`reset` prices the default type) | | `merge(remaining, succumbing)` | What merging the second town into the first costs, before any debt it takes on | diff --git a/gradle.properties b/gradle.properties index 753c941..bc9e2b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ kotlin.code.style=official plugin_version=1.1.1 # Dependency Versions -towny_version=0.103.2.7 +towny_version=0.103.2.10 diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/PricesMenu.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/PricesMenu.kt index 810964f..24ec774 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/PricesMenu.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/PricesMenu.kt @@ -6,6 +6,7 @@ import com.palmergames.bukkit.towny.permissions.PermissionNodes import net.trilleo.mc.plugins.townymenu.guis.framework.Icons import net.trilleo.mc.plugins.townymenu.guis.framework.Menu import net.trilleo.mc.plugins.townymenu.guis.tutorial.Tutorial +import net.trilleo.mc.plugins.townymenu.utils.Prices import net.trilleo.mc.plugins.townymenu.utils.TownyUtil import net.trilleo.mc.plugins.townymenu.utils.tr import org.bukkit.Material @@ -55,6 +56,7 @@ class PricesMenu(player: Player, back: Menu) : Menu(player, player.tr("prices.ti } add(cost("prices.claim-refund", TownySettings.getClaimRefundPrice())) add(cost("prices.bonus-claim", town?.bonusBlockCost ?: TownySettings.getPurchasedBonusBlocksCost())) + add(cost("prices.cede", Prices.cede())) if (TownySettings.isAllowingOutposts()) { add(cost("prices.outpost", TownySettings.getOutpostCost())) if (TownySettings.getPerOutpostUpkeepCost() > 0) { diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/admin/AdminWorldMenu.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/admin/AdminWorldMenu.kt index a35443e..c147782 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/admin/AdminWorldMenu.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/admin/AdminWorldMenu.kt @@ -12,7 +12,10 @@ import net.trilleo.mc.plugins.townymenu.utils.tr import org.bukkit.Material import org.bukkit.entity.Player -/** One world's Towny settings (`/townyworld`): toggles, wilderness permissions and name, and resetting to defaults. */ +/** + * One world's Towny settings (`/townyworld`): toggles, wilderness permissions and name, the minimum + * adjacent claims, and resetting to defaults. + */ class AdminWorldMenu(player: Player, private val world: TownyWorld, back: Menu) : Menu(player, player.tr("admin-world.title", "world" to TownyUtil.text(world.name)), 5, back) { @@ -58,6 +61,26 @@ class AdminWorldMenu(player: Player, private val world: TownyWorld, back: Menu) ) { run("$command set usedefault", ::snapshot) } + val adjacency = world.minAdjacentChunks + guarded( + 16, PermissionNodes.TOWNY_COMMAND_TOWNYWORLD_SET, + Icons.icon( + Material.COMPARATOR, tr("admin-world.min-adjacency"), tr("admin-world.min-adjacency-description"), + if (adjacency > 0) tr("admin-world.min-adjacency-current", "count" to adjacency) + else tr("common.current", "value" to tr("common.off")), + actions = hints("click.change") + ) + ) { + prompt( + tr("admin-world.min-adjacency"), + tr("admin-world.min-adjacency-label"), + tr("admin-world.min-adjacency-hint"), + initial = adjacency.coerceAtLeast(0).toString(), + maxLength = 2 + ) { value -> + run("$command set minadjacency ${TownyUtil.argument(value)}", { world.minAdjacentChunks }) + } + } WILD_PERMISSIONS.forEachIndexed { index, (type, material, key) -> val allowed = world.getUnclaimedZonePerm(type) @@ -76,7 +99,8 @@ class AdminWorldMenu(player: Player, private val world: TownyWorld, back: Menu) backButton(40) } - private fun snapshot(): List = toggleList().map { it.value() } + world.unclaimedZoneName + private fun snapshot(): List = + toggleList().map { it.value() } + world.unclaimedZoneName + world.minAdjacentChunks private fun toggles(): Menu = ToggleMenu(player, tr("admin-world.toggles-title", "world" to TownyUtil.text(world.name)), this, toggleList()) diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/OutpostsMenu.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/OutpostsMenu.kt index a14fc2e..8480dd5 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/OutpostsMenu.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/OutpostsMenu.kt @@ -1,21 +1,27 @@ package net.trilleo.mc.plugins.townymenu.guis.town +import com.palmergames.bukkit.towny.TownyAPI import com.palmergames.bukkit.towny.`object`.Town import net.trilleo.mc.plugins.townymenu.guis.framework.Icons import net.trilleo.mc.plugins.townymenu.guis.framework.Menu import net.trilleo.mc.plugins.townymenu.guis.framework.MenuEntry import net.trilleo.mc.plugins.townymenu.guis.framework.PagedMenu import net.trilleo.mc.plugins.townymenu.utils.Prices +import net.trilleo.mc.plugins.townymenu.utils.TownyUtil import net.trilleo.mc.plugins.townymenu.utils.tr import org.bukkit.Material import org.bukkit.entity.Player -/** Teleport targets for each of a town's outpost spawns. */ +/** + * A town's outpost spawns: teleport targets for the viewer's own town, and a read-only list of + * locations for any other town, since Towny only lets residents travel to their own outposts. + */ class OutpostsMenu(player: Player, private val town: Town, back: Menu) : - PagedMenu(player, player.tr("outposts.title"), back) { + PagedMenu(player, title(player, town), back) { override fun entries(): List { - val cost = costLine(Prices.townSpawn(player, town, outpost = true)) + val own = resident?.townOrNull == town + val cost = if (own) costLine(Prices.townSpawn(player, town, outpost = true)) else null return town.allOutpostSpawns.mapIndexed { index, location -> val icon = { Icons.icon( @@ -23,10 +29,16 @@ class OutpostsMenu(player: Player, private val town: Town, back: Menu) : tr("outposts.world", "world" to (location.world?.name ?: "-")), tr("outposts.location", "x" to location.blockX, "y" to location.blockY, "z" to location.blockZ), *listOfNotNull(cost).toTypedArray(), - actions = listOf(tr("click.teleport")) + actions = if (own) hints("click.teleport") else emptyList() ) } - MenuEntry(icon) { runAndClose("towny:town outpost ${index + 1}") } + if (own) MenuEntry(icon) { runAndClose("towny:town outpost ${index + 1}") } else MenuEntry(icon) } } + + private companion object { + fun title(player: Player, town: Town): String = + if (TownyAPI.getInstance().getResident(player)?.townOrNull == town) player.tr("outposts.title") + else player.tr("outposts.title-other", "town" to TownyUtil.name(town.name)) + } } diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownClaimsMenu.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownClaimsMenu.kt index 7e156df..9eda8f8 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownClaimsMenu.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownClaimsMenu.kt @@ -141,6 +141,7 @@ class TownClaimsMenu(player: Player, back: Menu) : Menu(player, player.tr("claim PermissionNodes.TOWNY_COMMAND_TOWN_CEDE_PLOT, Icons.icon( Material.OAK_BOAT, tr("claims.cede"), tr("claims.cede-description"), + *listOfNotNull(costLine(Prices.cede())).toTypedArray(), actions = hints("click.choose-town") ) ) { diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownInfoMenu.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownInfoMenu.kt index c723202..7c5be59 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownInfoMenu.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/town/TownInfoMenu.kt @@ -67,6 +67,18 @@ class TownInfoMenu(player: Player, private val town: Town, back: Menu) : NationInfoMenu(player, nation, this).open() } } + if (viewer?.townOrNull != town && town.hasOutpostSpawn() && !town.isRuined) { + grid.add( + PermissionNodes.TOWNY_COMMAND_TOWN_OUTPOST_LIST_OTHER, + Icons.icon( + Material.COMPASS, tr("town-info.outposts"), tr("town-info.outposts-description"), + tr("town.outposts", "count" to town.allOutpostSpawns.size), + actions = hints("click.view") + ) + ) { + OutpostsMenu(player, town, this).open() + } + } if (viewer != null && !viewer.hasTown() && town.isOpen) { grid.add( PermissionNodes.TOWNY_COMMAND_TOWN_JOIN, diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt index ac8513f..12abc26 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt @@ -18,6 +18,7 @@ import net.trilleo.mc.plugins.townymenu.guis.plot.PlotMenu import net.trilleo.mc.plugins.townymenu.guis.resident.FriendsMenu import net.trilleo.mc.plugins.townymenu.guis.resident.ResidentMenu import net.trilleo.mc.plugins.townymenu.guis.town.* +import net.trilleo.mc.plugins.townymenu.utils.Prices import net.trilleo.mc.plugins.townymenu.utils.TownyUtil import net.trilleo.mc.plugins.townymenu.utils.tr import org.bukkit.Material @@ -410,7 +411,9 @@ object Tutorial { }, Lesson( "claims/cede", Material.OAK_BOAT, "tutorial.claims.cede", "tutorial.claims.cede-body", - withTown { player, _, back -> TownClaimsMenu(player, back) }), + withTown { player, _, back -> TownClaimsMenu(player, back) }) { player -> + player.money(Prices.cede(), "tutorial.fact.cede-cost") + }, Lesson( "claims/takeover", Material.IRON_SWORD, "tutorial.claims.takeover", "tutorial.claims.takeover-body", withTown { player, _, back -> TownClaimsMenu(player, back) }, diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/utils/Prices.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/utils/Prices.kt index e996c3e..db0de31 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/utils/Prices.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/utils/Prices.kt @@ -28,6 +28,9 @@ object Prices { /** What claiming an outpost costs, whatever the town already owns. */ fun outpost(): Double = TownySettings.getOutpostCost() + /** What giving a chunk away with `/town cede plot` costs the town that gives it. */ + fun cede(): Double = TownySettings.getCedePlotCost().toDouble() + /** What a town gets back per unclaimed chunk. Negative when the server charges for unclaiming instead. */ fun unclaimRefund(): Double = TownySettings.getClaimRefundPrice() diff --git a/src/main/resources/lang/en_US.yml b/src/main/resources/lang/en_US.yml index 1895026..396c109 100644 --- a/src/main/resources/lang/en_US.yml +++ b/src/main/resources/lang/en_US.yml @@ -437,6 +437,7 @@ outlaws: outposts: title: "Outposts" + title-other: "Outposts: {town}" outpost: "Outpost #{number}" world: "World: {world}" location: "Location: {x}, {y}, {z}" @@ -538,6 +539,8 @@ town-info: invite-description: "Invite this town to join {nation}." merge: "Merge into Your Town" merge-description: "Ask the mayor of {town} to merge their town into {own}. They must be online to accept." + outposts: "Outposts" + outposts-description: "See where this town's outposts are." town-list: title: "Towns" @@ -771,6 +774,7 @@ prices: claim: "Per claim: {cost}" claim-refund: "Refund per unclaim: {cost}" bonus-claim: "Per bonus claim: {cost}" + cede: "Ceding a plot: {cost}" outpost: "Per outpost: {cost}" outpost-upkeep: "Daily upkeep per outpost: {cost}" upkeep: "Daily Upkeep" @@ -1194,6 +1198,11 @@ admin-world: rename-wild-description: "The name shown when players walk into unclaimed land." reset: "Reset to Defaults" reset-description: "Replace this world's settings with the new-world defaults from Towny's config." + min-adjacency: "Minimum Adjacent Claims" + min-adjacency-description: "How many of a town's own chunks a new claim in this world must touch. Outposts are exempt." + min-adjacency-current: "Current: {count}" + min-adjacency-label: "Adjacent chunks" + min-adjacency-hint: "Enter 1, 2, or 3, or 0 to turn the rule off." wild-build: "Wilderness Building" wild-destroy: "Wilderness Breaking" wild-switch: "Wilderness Switches" @@ -1537,6 +1546,7 @@ tutorial: claim-refund: "Refund per unclaimed chunk: {cost}" outposts-disabled: "Outposts are turned off on this server." outpost-cost: "Price per outpost: {cost}" + cede-cost: "Price per ceded plot: {cost}" bonus-cost: "Price per bonus claim: {cost}" jail-hours: "Longest jail sentence: {hours} hours" jailed: "You are jailed: {hours} hours left." @@ -1625,7 +1635,7 @@ tutorial: unclaim: "Unclaiming Land" unclaim-body: "Unclaim chunks you no longer need to free their claim slots. The home block can't be unclaimed. Some servers slowly restore unclaimed land to how it looked before." outposts: "Outposts" - outposts-body: "An outpost is a claim away from your town, such as a distant mine or farm. Each outpost has a spawn that residents can teleport to, and more land can be claimed around it. A mayor can also turn an existing claim into an outpost, or move an outpost's spawn, from the Plot menu." + outposts-body: "An outpost is a claim away from your town, such as a distant mine or farm. Each outpost has a spawn that residents can teleport to, and more land can be claimed around it. A mayor can also turn an existing claim into an outpost, or move an outpost's spawn, from the Plot menu. Another town's page has an Outposts button that shows where its outposts are." bonus: "Bonus Claims" bonus-body: "Reached your claim limit? Buy bonus claims with money from the town bank. The price can rise with each one you buy." cede: "Ceding Land" diff --git a/src/main/resources/lang/zh_CN.yml b/src/main/resources/lang/zh_CN.yml index 338f243..c59e126 100644 --- a/src/main/resources/lang/zh_CN.yml +++ b/src/main/resources/lang/zh_CN.yml @@ -436,6 +436,7 @@ outlaws: outposts: title: "前哨" + title-other: "前哨:{town}" outpost: "前哨 #{number}" world: "世界: {world}" location: "坐标: {x}, {y}, {z}" @@ -537,6 +538,8 @@ town-info: invite-description: "邀请该城镇加入 {nation}。" merge: "并入你的城镇" merge-description: "请求 {town} 的镇长将其城镇并入 {own}。对方必须在线并接受。" + outposts: "前哨" + outposts-description: "查看该城镇的前哨位于何处。" town-list: title: "城镇列表" @@ -770,6 +773,7 @@ prices: claim: "每块领地:{cost}" claim-refund: "放弃每块领地退还:{cost}" bonus-claim: "每块额外领地:{cost}" + cede: "割让地块:{cost}" outpost: "每个前哨:{cost}" outpost-upkeep: "每个前哨每日维护费:{cost}" upkeep: "每日维护费" @@ -1193,6 +1197,11 @@ admin-world: rename-wild-description: "玩家进入未声明土地时显示的名称。" reset: "恢复默认" reset-description: "用 Towny 配置中的新世界默认值替换此世界的设置。" + min-adjacency: "最少相邻领地" + min-adjacency-description: "在此世界中,新领地必须与城镇自己的多少个区块相邻。前哨不受此限制。" + min-adjacency-current: "当前:{count}" + min-adjacency-label: "相邻区块数" + min-adjacency-hint: "输入 1、2 或 3,输入 0 则关闭此规则。" wild-build: "荒野建造" wild-destroy: "荒野破坏" wild-switch: "荒野开关" @@ -1536,6 +1545,7 @@ tutorial: claim-refund: "每放弃一个区块退款: {cost}" outposts-disabled: "本服务器未启用前哨。" outpost-cost: "每个前哨价格: {cost}" + cede-cost: "每次割让地块价格: {cost}" bonus-cost: "每块额外领地价格: {cost}" jail-hours: "最长刑期: {hours} 小时" jailed: "你正在服刑,剩余 {hours} 小时。" @@ -1624,7 +1634,7 @@ tutorial: unclaim: "放弃土地" unclaim-body: "放弃不再需要的区块可以腾出领地名额。主区块不能被放弃。有些服务器会慢慢把被放弃的土地恢复原貌。" outposts: "前哨" - outposts-body: "前哨是远离城镇的领地,例如远处的矿场或农场。每个前哨都有居民可以传送过去的出生点,还可以在其周围继续占领土地。镇长也可以在地块菜单中把现有领地设为前哨,或移动前哨的出生点。" + outposts-body: "前哨是远离城镇的领地,例如远处的矿场或农场。每个前哨都有居民可以传送过去的出生点,还可以在其周围继续占领土地。镇长也可以在地块菜单中把现有领地设为前哨,或移动前哨的出生点。在其他城镇的页面中点击“前哨”按钮,可以查看其前哨的位置。" bonus: "额外领地" bonus-body: "领地达到上限了?用城镇银行的钱购买额外领地。每次购买后价格可能上涨。" cede: "割让土地" From 7506630f0922ca880529df234c110443585a4f9a Mon Sep 17 00:00:00 2001 From: Trilleo Date: Sun, 4 Oct 2026 10:55:30 +0800 Subject: [PATCH 2/4] Improvement: Add missing tutorials about jail and outpost --- CHANGELOG.md | 6 ++++++ .../trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt | 2 ++ src/main/resources/lang/en_US.yml | 2 ++ src/main/resources/lang/zh_CN.yml | 2 ++ 4 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb02a8..867046d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,12 @@ + The Cede This Plot button shows what ceding costs when the server charges for it (Towny's new `price_town_cede` setting), and so do the Prices menu and the Ceding Land lesson. +#### Tutorial + ++ The outposts lesson says when outposts can only be claimed in worlds where your town has no other land, and the + jailing lesson says when a nation's capital may jail any resident of the nation. Each line only appears when the + server has the matching Towny setting turned on. + ### Technical Details #### Misc diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt index 12abc26..5ed88aa 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/tutorial/Tutorial.kt @@ -391,6 +391,7 @@ object Tutorial { } else { buildList { addAll(player.money(TownySettings.getOutpostCost(), "tutorial.fact.outpost-cost")) + if (TownySettings.getOutpostsLimitedPerWorld()) add(player.tr("tutorial.fact.outposts-per-world")) town(player)?.let { add( player.tr( @@ -527,6 +528,7 @@ object Tutorial { addAll(player.money(TownySettings.getBailMaxAmount(), "tutorial.fact.max-bail")) } town(player)?.let { add(player.tr("town-jail.jails-count", "count" to it.jails.orEmpty().size)) } + if (TownySettings.canNationLeadersJailNationResidents()) add(player.tr("tutorial.fact.nation-jail")) } }, Lesson( diff --git a/src/main/resources/lang/en_US.yml b/src/main/resources/lang/en_US.yml index 396c109..3eb4d1e 100644 --- a/src/main/resources/lang/en_US.yml +++ b/src/main/resources/lang/en_US.yml @@ -1546,9 +1546,11 @@ tutorial: claim-refund: "Refund per unclaimed chunk: {cost}" outposts-disabled: "Outposts are turned off on this server." outpost-cost: "Price per outpost: {cost}" + outposts-per-world: "Outposts can only be claimed in worlds where your town has no other land." cede-cost: "Price per ceded plot: {cost}" bonus-cost: "Price per bonus claim: {cost}" jail-hours: "Longest jail sentence: {hours} hours" + nation-jail: "The capital can jail any resident of its nation, not just its own." jailed: "You are jailed: {hours} hours left." join-nation-residents: "Residents a town needs to join a nation: {count}" nation-cost: "Founding a nation costs: {cost}" diff --git a/src/main/resources/lang/zh_CN.yml b/src/main/resources/lang/zh_CN.yml index c59e126..2732f3f 100644 --- a/src/main/resources/lang/zh_CN.yml +++ b/src/main/resources/lang/zh_CN.yml @@ -1545,9 +1545,11 @@ tutorial: claim-refund: "每放弃一个区块退款: {cost}" outposts-disabled: "本服务器未启用前哨。" outpost-cost: "每个前哨价格: {cost}" + outposts-per-world: "只能在你的城镇尚无其他领地的世界中占领前哨。" cede-cost: "每次割让地块价格: {cost}" bonus-cost: "每块额外领地价格: {cost}" jail-hours: "最长刑期: {hours} 小时" + nation-jail: "首都可以关押本国的任何居民,而不仅是本镇居民。" jailed: "你正在服刑,剩余 {hours} 小时。" join-nation-residents: "城镇加入国家所需居民数: {count}" nation-cost: "建立国家费用: {cost}" From 44938bb65b40cd485b608c0da087e2fb8b737b5a Mon Sep 17 00:00:00 2001 From: Trilleo Date: Sun, 4 Oct 2026 10:56:07 +0800 Subject: [PATCH 3/4] Improvement: Reformat source code --- .../net/trilleo/mc/plugins/townymenu/guis/BorderViewMenu.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/BorderViewMenu.kt b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/BorderViewMenu.kt index 703c8b5..8b6fc6a 100644 --- a/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/BorderViewMenu.kt +++ b/src/main/kotlin/net/trilleo/mc/plugins/townymenu/guis/BorderViewMenu.kt @@ -13,7 +13,10 @@ class BorderViewMenu(player: Player, back: Menu?) : Menu(player, player.tr("bord override fun build() { if (!BorderView.available) { - button(13, Icons.icon(Material.BARRIER, tr("border-view.unavailable"), tr("border-view.unavailable-description"))) + button( + 13, + Icons.icon(Material.BARRIER, tr("border-view.unavailable"), tr("border-view.unavailable-description")) + ) backButton(22) return } From a4e4f97b9ac657aff102a87028dbee562d54b3d0 Mon Sep 17 00:00:00 2001 From: Trilleo Date: Sun, 4 Oct 2026 10:56:54 +0800 Subject: [PATCH 4/4] Update: Plugin version 1.1.2 release --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 867046d..77982c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## Version 1.1.2 + ### New Features #### Town Menu diff --git a/gradle.properties b/gradle.properties index bc9e2b9..5ca02c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ kotlin.code.style=official # Plugin Properties -plugin_version=1.1.1 +plugin_version=1.1.2 # Dependency Versions towny_version=0.103.2.10