Skip to content

Commit

Permalink
v1.17.3-ALPHA
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoMorin committed Sep 17, 2024
1 parent f118cb9 commit b2f541c
Show file tree
Hide file tree
Showing 110 changed files with 4,221 additions and 441 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 11 additions & 8 deletions addons/addon-meta.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
outposts:
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'
version: '3.0.1.6.6'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Outposts-3.0.1.6.6.jar?raw=true'
supported-core-version: 1.17.2-ALHPA

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

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

enginehub:
version: '1.0.0.2'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-1.0.0.2.jar?raw=true'
version: '1.0.0.3'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-1.0.0.3.jar?raw=true'
supported-core-version: 1.17.2-ALHPA
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.kingdoms.services.mythicmobs.conditions;

import io.lumine.mythic.api.skills.conditions.ISkillCondition;
import io.lumine.mythic.bukkit.events.MythicConditionLoadEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

public final class KingdomsMythicMobConditionListener implements Listener {
protected static final Map<String, ISkillCondition> CONDITIONS = new HashMap<>();

@EventHandler
public void onConditionLoad(MythicConditionLoadEvent event) {
String conditionName = event.getConditionName().toLowerCase(Locale.ENGLISH);
ISkillCondition condition = CONDITIONS.get(conditionName);
if (condition != null) event.register(condition);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.kingdoms.services.mythicmobs.conditions;

public final class MythicMobConditionRegistry {
public static void register(String name, SimpleRelationalChecker checker) {
String id = "kingdoms_" + name;
KingdomsMythicMobConditionListener.CONDITIONS.put(id, new RelationalMythicMobSkillCondition(id, checker));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.kingdoms.services.mythicmobs.conditions;

import io.lumine.mythic.api.adapters.AbstractEntity;
import io.lumine.mythic.api.skills.conditions.IEntityComparisonCondition;
import io.lumine.mythic.core.skills.SkillCondition;

/**
* SkillCondition is an abstract class that handles many ISkillConditions that the class implements.
*/
public class RelationalMythicMobSkillCondition extends SkillCondition implements IEntityComparisonCondition {
private final SimpleRelationalChecker checker;

public RelationalMythicMobSkillCondition(String line, SimpleRelationalChecker checker) {
super(line);
this.checker = checker;
}

@Override
public boolean check(AbstractEntity caster, AbstractEntity target) {
// Caster must be a player and be in a kingdom.
return checker.check(caster.getBukkitEntity(), target.getBukkitEntity());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.kingdoms.services.mythicmobs.conditions;

import org.bukkit.entity.Entity;

public interface SimpleRelationalChecker {
boolean check(Entity caster, Entity target);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.Zrips.CMI.Containers.CMIUser;
import org.bukkit.entity.Player;

import java.util.UUID;

public final class ServiceCMI implements ServiceCommons {
@Override
public boolean isVanished(Player player) {
Expand Down Expand Up @@ -33,8 +35,8 @@ public boolean isInGodMode(Player player) {
}

@Override
public boolean isIgnoring(Player ignorant, Player ignoring) {
public boolean isIgnoring(Player ignorant, UUID ignoring) {
CMIUser user = getUser(ignorant);
return user != null && user.isIgnoring(ignoring.getUniqueId());
return user != null && user.isIgnoring(ignoring);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import org.bukkit.entity.Player;
import org.kingdoms.services.Service;

import java.util.UUID;

public interface ServiceCommons extends Service {
boolean isVanished(Player player);

boolean isInGodMode(Player player);

boolean isIgnoring(Player ignorant, Player ignoring);
boolean isIgnoring(Player ignorant, UUID ignoring);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

import java.util.UUID;

// https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/User.java
public final class ServiceEssentialsX implements ServiceCommons {
private static final Essentials ESS = (Essentials) Bukkit.getPluginManager().getPlugin("Essentials");
Expand All @@ -19,7 +21,7 @@ public boolean isInGodMode(Player player) {
}

@Override
public boolean isIgnoring(Player ignorant, Player ignoring) {
public boolean isIgnoring(Player ignorant, UUID ignoring) {
return ESS.getUser(ignorant).isIgnoredPlayer(ESS.getUser(ignoring));
}
}
118 changes: 106 additions & 12 deletions core/src/main/resources/Structures/outpost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
<material-2>: HAY_BLOCK
<material-3>: HAY_BLOCK

'[fn-base]': &fn-base
args: [ "<cost>", "<material>" ]
return:
buy: 'percentOf(10, <cost> * (initial / stock)) + (<cost> * (initial / stock))'
sell: '<cost> * (initial / stock)'
stock:
initial: 10000
max: 100000
min: 500
item:
material: <material>

name: "&eOutpost"
default-name: 'Outpost'
type: outpost
Expand All @@ -16,14 +28,49 @@ limits:
per-land: 1
total: 10

# A kingdom-wide limit that prevents players from
# purchasing certain items after a certain amount is purchased.
purchase-limits:
diamonds: # This name doesn't matter
# Here you can use ItemMatcher properties
# https://github.com/CryptoMorin/KingdomsX/wiki/Config#item-matchers
material: DIAMOND
purchase-limit: # This special section needs to be present
# The items that can be sold in the outpost structure.
stocks:
# The name of each entry is basically the ID of the item,
# this ID is used for saving server-wide stock data and being
# used in the GUI with the "stock-" prefix.
# For example, this particular item will be referenced as "stock-diamonds" in the GUI.
diamonds: # <--- Note this name is important
# The amount of resource points used for buying this item from the structure.
# Here you can use the special placeholder "stock" which is the amount of this
# item that is held by the server-wide stock and can be used to adjust prices.
# Note: Other options below use the *fn-base function which basically repeats this
# equation for easier configuration.
buy: 'percentOf(10, 60 * (initial / stock)) + (60 * (initial / stock))'

# The amount of resource points used for selling this item to the structure.
# Supports "stock" placeholder just like the buy option.
sell: '60 * (initial / stock)'

# Settings for the "stock" variable used for buy/sell options
# This is a server-wide variable shared between all outpost structures.
# When players buy this item from an outpost, it'll decrease the amount
# of stock depending on how much they bought, when they sell the same item,
# the market stock will increase.
stock: &stock
# The initial value assigned. This is permanent and the server
# will save this data, so changing this option will not work
# unless you reset your data.
initial: 10000

# No matter how many items the players buy/sell the stock value
# will not go out of this range.
max: 100000
min: 500

# The item given to the player after they purchase it.
# (The amount is adjusted automatically)
# The items sold will have to match this exact same description.
item:
material: DIAMOND

# A kingdom-wide limit that prevents players from
# purchasing certain items after a certain amount is purchased.
purchase-limit:
# The cooldown doesn't persist between restarts.

# We're using math here to make it easier to understand.
Expand All @@ -35,11 +82,58 @@ purchase-limits:
# Players will not be able to purchase items if the total cooldown
# is going to be more than this limit.
max-cooldown: 6hrs # %outpost_max_cooldown%
xp:
material: EXPERIENCE_BOTTLE

emerald: *fn-base [ 70, EMERALD ]
gold-ingot: *fn-base [ 50, GOLD_INGOT ]
iron-ingot: *fn-base [ 40, IRON_INGOT ]
nether-brick: *fn-base [ 30, NETHER_BRICK ]
brick: *fn-base [ 20, BRICK ]
lapis-lazuli: *fn-base [ 15, LAPIS_LAZULI ]
coal: *fn-base [ 3, COAL ]
charcoal: *fn-base [ 2, CHARCOAL ]

ender-eye: *fn-base [ 1000, ENDER_EYE ]
ender-pearl: *fn-base [ 100, ENDER_PEARL ]
dragon-breath: *fn-base [ 3000, DRAGON_BREATH ]
blaze-rod: *fn-base [ 20, BLAZE_ROD ]
blaze-powder: *fn-base [ 30, BLAZE_POWDER ]
prismarine-crystals: *fn-base [ 20, PRISMARINE_CRYSTALS ]

golden-carrot: *fn-base [ 50, GOLDEN_CARROT ]
magma-cream: *fn-base [ 50, MAGMA_CREAM ]
slime-ball: *fn-base [ 30, SLIME_BALL ]
flint: *fn-base [ 1, FLINT ]
book: *fn-base [ 10, BOOK ]

xp-bottle:
<<: *fn-base [ 30, EXPERIENCE_BOTTLE ]
purchase-limit:
cooldown-per-item: '[1hr] / 64'
max-cooldown: 1hr
max-cooldown: 1hrs

cooked-rabbit: *fn-base [ 3, COOKED_RABBIT ]
cooked-beef: *fn-base [ 2, COOKED_BEEF ]
cooked-porkchop: *fn-base [ 2, COOKED_PORKCHOP ]
cooked-chicken: *fn-base [ 1, COOKED_CHICKEN ]
cooked-fish: *fn-base [ 1, COOKED_COD ]
cooked-salmon: *fn-base [ 1, COOKED_SALMON ]
cooked-mutton: *fn-base [ 1, COOKED_MUTTON ]

wool: *fn-base [ 15, WHITE_WOOL ]
string: *fn-base [ 1, STRING ]
bucket: *fn-base [ 80, BUCKET ]
bone-meal: *fn-base [ 3, BONE_MEAL ]
rail: *fn-base [ 3, RAIL ]
glass: *fn-base [ 25, GLASS ]
ghast-tear: *fn-base [ 100, GHAST_TEAR ]

redstone-torch: *fn-base [ 5, REDSTONE_TORCH ]
repeater: *fn-base [ 10, REPEATER ]
comparator: *fn-base [ 15, COMPARATOR ]
dispenser: *fn-base [ 30, DISPENSER ]
dropper: *fn-base [ 20, DROPPER ]
hopper: *fn-base [ 200, HOPPER ]
piston: *fn-base [ 80, PISTON ]

particles:
1:
Expand All @@ -63,4 +157,4 @@ item:
- "&7It enables you to access turrets, upgrades,"
- "and unlockable structures."
- "&7Outposts can produce exp bottles from"
- "resource points aswell."
- "resource points aswell."
6 changes: 6 additions & 0 deletions core/src/main/resources/Turrets/healing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ entities:
whitelist: true
list: [ PLAYER ]

# Repairs a random player armor if they're wearing one.
# This only works if the player needs healing so it won't work
# when on full health. It works exactly like mending except that
# if all armors are fully repaired, it doesn't give you exp.
repair-armor: lvl * 3

fire: 100
particle:
1:
Expand Down
10 changes: 10 additions & 0 deletions core/src/main/resources/chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ channels:
# Set to ~ (without quotes) to disable.
direct-prefix: '@'

# A way for players to show the item they're holding to other
# players in the chat with a simple hover message.
show-item:
# Currently only the main hand is supported.
main-hand:
replace:
'[i]': &show-item '{$sep}[%item_displayname%{? item_amount == 1 ? "" : " &9x%item_amount%"}{$sep}]'
'[item]': *show-item
'[show]': *show-item

# The chat priority that kingdom handles. Note that changing this will not disable the chat in any way.
# This is used when you're using another plugin that manages chat spams and other restrictions. You might want to increase the priorty in these cases.
# This option requires a restart to work.
Expand Down
24 changes: 22 additions & 2 deletions core/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ database:

ssl:
# Enable SSL connections. It's not recommended to disable it.
enabled: true
# Most people don't have a SSL connection setup, so this is disabled by default.
enabled: false

# Whether invalid host names should be allowed.
# Take care before setting this to false, as it makes the application susceptible to man-in-the-middle attacks.
Expand Down Expand Up @@ -418,6 +419,16 @@ commands:
# cooldown: 0
# disabled-worlds: []

# The default permission to assign to this command. Some commands have default permission that
# allows everyone to uses them, and removing the permission can be difficult at times using a
# permission plugin, so this option handles that.
# - Values:
# * OP: Only opped players (/op) can use this command.
# * NOT_OP: Only players that are not opped can use this command.
# * EVERYONE: Everyone can use this command.
# * NO_ONE: No one can use this command.
# permission-default: OP | NOT_OP | EVERYONE | NO_ONE

# To edit the command names and aliases refer to your language file.

# You cannot move the position of command arguments or change their group/parent
Expand Down Expand Up @@ -1538,7 +1549,16 @@ home:
# If safe home is enabled, it'll set the home in the
# center of the block without changing the rotation.
# This option basically forces /k sethome centerAxis
safe: false
center: false

# If enabled, Checks if the kingdom home is safe before teleporting.
# If not it'll try to find a safe location to teleport to within
# 5 block radius.
# If there are no safe locations, it'll warn the player if they still
# want to teleport anyway.
check-safe:
self: true
others: true

# Used to prevent players from escaping PvP in seconds.
# Teleportation will be cancelled if the player gets damaged.
Expand Down
16 changes: 16 additions & 0 deletions core/src/main/resources/guis/structures/nexus/logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ rows: 6
{$p}Shield Duration{$sep}: {$s}%old-shield-time% {$sep}➜ {$s}%new-shield-time%
{$p}Resource Points Cost{$sep}: {$s}%fancy@resource_points%
{$p}At{$sep}: {$s}%time%
shield-deactivation:
material: SHIELD
name: '&5Shield Deactivation'
lore: |
{$s}%player% {$p}has deactivated the
kingdom's shield.
{$p}Shield Duration{$sep}: {$s}%old-shield-time%
{$p}At{$sep}: {$s}%time%
kingdom-relation-change:
material: NETHER_STAR
name: '&9Relationship Change'
Expand Down Expand Up @@ -383,6 +391,14 @@ rows: 6
lore: |
{$p}Your kingdom has left
{$s}%kingdoms_nation_name% {$p}nation.
{$p}At{$sep}: {$s}%time%
kingdom-vault-item-move:
material: PAPER
name: "&cKingdom Vault Item Move"
lore: |
{$p}Changes{$sep}:
%changes%
{$p}At{$sep}: {$s}%time%
'PeaceTreaties:received':
material: BOOK
Expand Down
Loading

0 comments on commit b2f541c

Please sign in to comment.