Skip to content

Commit

Permalink
v1.17.2-ALPHA
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoMorin committed Aug 17, 2024
1 parent 322205d commit f118cb9
Show file tree
Hide file tree
Showing 80 changed files with 1,173 additions and 212 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ core/src/test/java/PrivateVault.java
!core/src/main/
!core/src/main/resources/
!core/src/main/resources/**
!core/src/main/java/org/kingdoms/services

!core/service/
!core/service/**
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed addons/Kingdoms-Addon-Outposts-3.0.1.6.4.jar
Binary file not shown.
Binary file added addons/Kingdoms-Addon-Outposts-3.0.1.6.5.jar
Binary file not shown.
Binary file removed addons/Kingdoms-Addon-Peace-Treaties-1.2.6.0.4.jar
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions addons/addon-meta-template.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
outposts:
version: '<outposts-version>'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Outposts-<outposts-version>.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
supported-core-version: 1.17.2-ALHPA

map-viewers:
version: '<map-viewers-version>'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Map-Viewers-<map-viewers-version>.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
supported-core-version: 1.17.2-ALHPA

peace-treaties:
version: '<peace-treaties-version>'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Peace-Treaties-<peace-treaties-version>.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
supported-core-version: 1.17.2-ALHPA

enginehub:
version: '<enginehub-version>'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-<enginehub-version>.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
supported-core-version: 1.17.2-ALHPA
24 changes: 12 additions & 12 deletions addons/addon-meta.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
outposts:
version: '3.0.1.6.4'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Outposts-3.0.1.6.4.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
version: '3.0.1.6.5'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Outposts-3.0.1.6.5.jar?raw=true'
supported-core-version: 1.17.2-ALHPA
map-viewers:
version: '2.1.0.3'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Map-Viewers-2.1.0.3.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
version: '2.1.0.4'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Map-Viewers-2.1.0.4.jar?raw=true'
supported-core-version: 1.17.2-ALHPA
peace-treaties:
version: '1.2.6.0.4'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Peace-Treaties-1.2.6.0.4.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
version: '1.2.6.0.5'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Peace-Treaties-1.2.6.0.5.jar?raw=true'
supported-core-version: 1.17.2-ALHPA
enginehub:
version: '1.0.0.1'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-1.0.0.1.jar?raw=true'
supported-core-version: 1.17.1-ALHPA
version: '1.0.0.2'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-1.0.0.2.jar?raw=true'
supported-core-version: 1.17.2-ALHPA
2 changes: 1 addition & 1 deletion core/service/vanish/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ group = "org.kingdoms.services.vanish"
version = "2.0.0"

repositories {
//maven("https://repo.essentialsx.net/snapshots/")
// maven("https://repo.essentialsx.net/snapshots/")
maven("https://repo.essentialsx.net/releases/")
}

Expand Down
1 change: 1 addition & 0 deletions core/service/vault/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ version = "1.0.0"

dependencies {
compileOnly(project(":core:service"))
compileOnly(project(":shared"))
compileOnly("com.github.MilkBowl:VaultAPI:1.7") { isTransitive = false } // https://github.com/MilkBowl/VaultAPI
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public static void withdraw(OfflinePlayer player, double amount) {
getEconomy().withdrawPlayer(player, amount);
}

public static VaultBalance getBalance(OfflinePlayer player) {
return new VaultBalance(player);
}

public static String getGroup(Player player) {
if (getPermission() == null) return "default";
return getPermission().hasGroupSupport() ? getPermission().getPrimaryGroup(player) : "default";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.kingdoms.services

import org.bukkit.OfflinePlayer
import org.kingdoms.constants.economy.AbstractEconomy
import org.kingdoms.constants.economy.Balance
import org.kingdoms.constants.namespace.Namespace

object VaultEconomy : AbstractEconomy(Namespace("VAULT", "MAIN")) {
override fun isAvailable() = ServiceVault.isAvailable(ServiceVault.Component.ECO)
}

class VaultBalance(private val account: OfflinePlayer) : Balance {
override fun get(): Double = ServiceVault.getMoney(account)
override fun set(value: Number): Double {
val bal = get()
val dbVal = value.toDouble()
if (bal > dbVal) {
ServiceVault.withdraw(account, bal - dbVal)
} else if (bal < dbVal) {
ServiceVault.deposit(account, dbVal - bal)
}
return dbVal
}

override fun getEconomy() = VaultEconomy
}
6 changes: 6 additions & 0 deletions core/src/main/resources/Structures/regulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type: regulator
# so this cost is for a full refill.
auto-fill-cost: "maxAmmo / 3"

# The default option values when a new entry (player/kingdom)
# is added to the regulator.
defaults:
attributes:
BUILD: false

particles:
1:
place:
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ cancel: true
recipients:
# Enable this option if you want to allow certain features such as
# /ignore command from other plugins to work.
# This will cause /k admin spy to stop working.
respect-others: false

# Only useful when cancel is false
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/claims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ indicator:
particles:
horizontal:
name: 'Horizontal'
particle: REDSTONE
particle: DUST # Former REDSTONE
count: 2
height: 10
delay: 10
Expand All @@ -320,7 +320,7 @@ indicator:
horizontal: 30
vertical:
name: 'Vertical'
particle: REDSTONE
particle: DUST
count: 2
height: 5
delay: 10
Expand Down
161 changes: 121 additions & 40 deletions core/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -689,36 +689,64 @@ top-kingdoms:
# Equation used for calculating a kingdoms might.
# A kingdoms "might" determines a kingdom's rank in /k top
# Higher "might" means higher rank.
might: "kingdoms_resource_points + kingdoms_members"
# * Note: Every item you add here will consume a significant amount of your RAM
# depending on how many kingdoms your server has.
types:
default:
name: Might
equation: "kingdoms_resource_points + kingdoms_members"
filter: "!kingdoms_kingdom_is_pacifist"
description: "The default equation. Compares kingdoms based on their resource points and kingdoms. Excludes pacifist kingdoms."
resource-points:
name: Resource Points
equation: "kingdoms_resource_points"
description: "Compares kingdoms based on their resource points."
lands:
name: Lands
equation: "kingdoms_claims"
description: "Compares kingdoms based on the amount of claims they have."
members:
name: Members
equation: "kingdoms_members"
description: "Compares kingdoms based on the amount of members they have."

# Updates top leaderboard
update-interval: 30min

# The limit of kingdom entries shown on each /k top page
amount: 10

# Show kingdoms that are pacifist in the list.
show-pacifists: false

# Rewards uses the "default" equation.
rewards:
# Set it to 0 to disable.
top: 10
resource-points: "10000 / rank"
bank: "1000 / rank"

# https://github.com/CryptoMorin/KingdomsX/wiki/Introduction#might
# Used in /k nation top
# Refer to "top-kingdoms" section above for more information.
top-nations:
# Equation used for calculating a kingdoms might.
# A kingdoms "might" determines a kingdom's rank in /k top
# Higher "might" means higher rank.
might: "kingdoms_nation_resource_points + kingdoms_nation_kingdoms"
types:
default:
name: Might
equation: "kingdoms_nation_resource_points + kingdoms_nation_kingdoms"
description: "The default equation. Compares nations based on their resource points and kingdoms."
resource-points:
name: Resource Points
equation: "kingdoms_nation_resource_points"
description: "Compares nations based on their resource points."
lands:
name: Lands
equation: "{kingdoms_nation:sum of=claims}"
description: "Compares nations based on the total amount of claims their kingdom members have."
kingdoms:
name: Kingdoms
equation: "kingdoms_nation_kingdoms"
description: "Compares nations based on the amount of kingdoms they have."

# The limit of nation entries shown on each /k nation top page
update-interval: 30min
amount: 10

rewards:
# Set it to 0 to disable.
top: 10
resource-points: "10000 / rank"
bank: "1000 / rank"
Expand Down Expand Up @@ -957,9 +985,12 @@ economy:
nations: 100000000

resource-points:
# Means that each resource point is worth $0.5
# So in order to get $2 you have to deposit 4 rp
worth: 0.5
worth:
# This means that buying 1 resource point, costs $5
buy: 5

# This means that selling 1 resource point, will give you $0.5.
sell: 0.5

# Minimum amount of resource points that can be withdrawn.
# This helps if your economy plugin doesn't support decimal currencies.
Expand Down Expand Up @@ -996,24 +1027,61 @@ daily-checks:

# For information check: https://github.com/CryptoMorin/KingdomsX/wiki/Introduction#elections
elections:
# Requires a restart.
enabled: false
kingdoms:
# Requires a restart.
enabled: false

# The interval in days for election events.
interval: 7

# The interval in days for election events.
interval: 7
candidate-requirements:
# How long should this member be a part of this kingdom?
member-for: 1 month

# The total voting percentage to consider election results.
# Meaning that more than 50% of kingdom members need to vote (for anyone)
# in order for a new king to be chosen.
vote-percentage: 50
# The fee that the player has to pay to the kingdom to be a candidate.
fee: 5000

# The duration of election events before the results are evaluated.
duration: 24hrs
other-conditions: { }

# This is to prevent abusing the voting system.
disallow:
joins: true
kicks: true
# The total voting percentage to consider election results.
# Meaning that more than 50% of kingdom members need to vote (for anyone)
# in order for a new king to be chosen, otherwise the elections will be cancelled.
vote-percentage: 50

# How to sort the candidates in the elections GUI?
# When hiding the vote count, this reduces the players bias.
# * Available options:
# - VOTES: Sort by the amount of votes the candidates have from most to least.
# - SHUFFLE: Random order every time the GUI is opened.
# - REGISTRATION_DATE: Sort by the time they registered as a candidate from old to recent.
sort-by: GROUP_VOTES

# The duration of election events before the results are evaluated.
duration: 24hrs

# This is to prevent abusing the voting system.
disallow:
joins: true
kicks: true
nations:
# The same rules of kingdom options above apply to the options below.
enabled: false
interval: 7
candidate-requirements:
# How long should this kingdom be a part of this nation?
member-for: 1 month

# The fee that the kingdom has to pay from their bank to the nation.
fee: 10000

other-conditions: { }
vote-percentage: 50
sort-by: VOTES
duration: 24hrs
only-allow-kings-to-vote: false
disallow:
joins: true
kicks: true

# The time zone ID.
# You can find yours here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Expand Down Expand Up @@ -1204,6 +1272,8 @@ nexus:
# The amount of resourcepoints taken from the kingdom that owns the nexus and given to the kingdom who broke the nexus.
# Nothing will happen if they don't have any resource points.
break:
enabled: true

# Resource points only given if the nexus is broken with a certain item.
item:
material: DIAMOND_HOE
Expand Down Expand Up @@ -1319,17 +1389,28 @@ nexus:
#|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|#

invitations:
# Allows members to invite offline players.
allow-offline-invites: true

# Allow invitation from other kingdoms if the player is already in a kingdom.
# If the player accepts, then he'll be kicked from the previous kingdom and join the new one.
allow-from-other-kingdoms: false

# If a player is invited to multiple kingdoms then a GUI (invite.yml) will open
# with a list of kingdoms invitations. Otherwise, the last invite will be automatically
# declined and replaced with the new invite.
allow-multiple-invites: true
allow:
# Allows members to invite offline players.
offline-invites: true

# Allow invitation from other kingdoms if the player is already in a kingdom.
# If the player accepts, then he'll be kicked from the previous kingdom and join the new one.
from-other-kingdoms: false

# If a player is invited to multiple kingdoms then a GUI (invite.yml) will open
# with a list of kingdoms invitations. Otherwise, the last invite will be automatically
# declined and replaced with the new invite.
multiple-invites: true

# Any other conditions that prevents someone from inviting a player.
# The primary context of these conditions is the inviter and the secondary is the
# person that's being invited.
# The key is the condition, the value is the message.
other-conditions:
# This default condition prevents people from inviting if their kingdom is already full.
# Even if this condition is removed, and the player is invited, they cannot accept the invite
# until the kingdom has free space.
'kingdoms_members >= kingdoms_max_members': '{$$command.invite.max-members}'

# Automatically deny each invitation - in seconds. Set to 0 to disable (not recommended)
# This is for online invitations.
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/declarations/mine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
<build-duration-factor>: str
<durability-factor>: int
<material>: str

hide-holograms: true
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ options:
can teleport to it using
{$p}/k home %kingdoms_kingdom_name%
{$p}Left-click &7to toggle public homes.
{$p}Right-click &7to set public home cost.
This cost is only for people outside of your
kingdom.
{$p}Current Home Tax{$colon} {$s}%kingdoms_kingdom_taxes_home%
{$note} Both kingdoms need to have
the HOME relationship attribute for
your relationship for this to work.
Expand Down
Loading

0 comments on commit f118cb9

Please sign in to comment.