Skip to content

Upgrades

Alexisleder edited this page Jul 8, 2026 · 2 revisions

Upgrades

This page explains how protection upgrades work in LederProtections.

Upgrades allow players to increase the size of an existing protection instead of removing it and placing a larger stone manually.


What is a Protection Upgrade?

A protection upgrade changes an existing protection from one configured size to a larger configured size.

Example upgrade path:

x4 → x8 → x16 → x32 → x64

When a player upgrades a protection, LederProtections can:

  • check if the next upgrade exists;
  • check if the player has permission;
  • check if the larger area is free;
  • check if the larger area overlaps another protection;
  • charge an economy cost if enabled;
  • update the WorldGuard region;
  • update the protection data;
  • update the physical protection stone if configured.

Upgrade Requirements

An upgrade may require:

Requirement Description
Valid protection The protection must exist and be loaded.
Ownership or access The player must be allowed to upgrade the protection.
Upgrade path The current stone must define a next upgrade.
Free area The larger area must not overlap another protection.
Permission The player may need permission for the next stone size.
Economy Vault and an economy plugin are required if upgrades cost money.
Successful save The updated protection must be saved correctly.

Upgrade Path

Upgrade paths are usually configured in:

plugins/LederProtections/stones.yml

Example:

stones:
  x16:
    radius: 16
    price: 5000.0
    upgrade:
      enabled: true
      next: "x32"

  x32:
    radius: 32
    price: 12000.0
    upgrade:
      enabled: true
      next: "x64"

The exact structure may depend on your generated stones.yml.


Example Upgrade Chain

A common setup:

Stone Radius Next upgrade
x4 4 x8
x8 8 x16
x16 16 x32
x32 32 x64
x64 64 None

The last stone in the chain usually has no next upgrade.


Upgrade Cost

If Vault and an economy plugin are installed, upgrades can have a cost.

A common model is to charge only the difference between the current stone price and the next stone price.

Example:

Current stone Current value Next stone Next value Upgrade cost
x4 500 x8 1500 1000
x8 1500 x16 5000 3500
x16 5000 x32 12000 7000
x32 12000 x64 30000 18000

This prevents players from paying the full price again when upgrading.


Economy Requirements

Paid upgrades require:

  • Vault;
  • a Vault-compatible economy plugin;
  • economy features enabled in configuration;
  • enough player balance.

If Vault is not installed, paid upgrade features will not work.

Depending on configuration, free upgrades may still be possible.


Permissions

Players may need permission to upgrade protections.

Common permissions:

lederprotections.upgrade

Stone-specific permissions may also apply:

lederprotections.stone.4
lederprotections.stone.8
lederprotections.stone.16
lederprotections.stone.32
lederprotections.stone.64

Example:

Rank Suggested permissions
Default lederprotections.stone.4, lederprotections.stone.8, lederprotections.stone.16
VIP lederprotections.stone.32
Premium lederprotections.stone.64
Admin Admin permissions and optional bypass

This allows server owners to restrict larger upgrades to specific ranks.


Area Validation

Before applying an upgrade, LederProtections checks whether the larger area is valid.

The upgrade should fail if the new protection area would overlap another protection.

Example:

A player owns an x16 protection.
They try to upgrade to x32.
Another protection is too close.
The upgrade is denied.

This prevents players from expanding into another player's protected area.


Overlap Prevention

Overlap prevention is important for upgrade safety.

Common behavior:

Situation Expected result
Larger area is free Upgrade allowed.
Larger area overlaps another protection Upgrade denied.
Larger area overlaps the same protection Allowed as part of resizing.
WorldGuard update fails Upgrade denied or rolled back.
Save fails Upgrade should not report success.

Physical Stone Update

Depending on configuration, upgrading a protection may also update the physical protection stone block.

Example:

Upgrade Possible physical change
x16 → x32 Iron-related stone changes to gold-related stone.
x32 → x64 Gold-related stone changes to emerald-related stone.

This helps players visually identify the current protection tier.

The exact materials depend on stones.yml.


Upgrade GUI

Upgrades are usually managed through the protection GUI.

Typical flow:

  1. Run /p.
  2. Select a protection.
  3. Open the protection management menu.
  4. Select the upgrade option.
  5. Review the upgrade information.
  6. Confirm the upgrade.
  7. LederProtections validates the upgrade.
  8. If valid, the protection is upgraded.

The GUI should only report success if the upgrade actually completes.


Upgrade Safety

LederProtections should avoid unsafe upgrade behavior.

Important safety goals:

Situation Expected behavior
Player has enough money and area is free Upgrade succeeds.
Player does not have enough money Upgrade is denied.
Larger area overlaps another protection Upgrade is denied.
Economy withdrawal fails Upgrade is denied.
Region update fails Upgrade is denied or rolled back.
Data save fails Success is not reported.

Recommended Upgrade Tests

Before using upgrades in production, test:

Test Expected result
Upgrade with enough money Protection upgrades successfully.
Upgrade without enough money Upgrade is denied and no money is taken.
Upgrade near another protection Upgrade is denied if it overlaps.
Upgrade with full inventory Behavior remains safe.
Upgrade to final tier Final tier has no further upgrade.
Server restart after upgrade Protection remains upgraded.
/p after upgrade GUI shows updated protection size.
/lep admin after upgrade Admin browser shows updated details.

Recommended Pricing

Example pricing for a survival server:

Stone Radius Example price
x4 4 500
x8 8 1500
x16 16 5000
x32 32 12000
x64 64 30000

Example upgrade costs using price difference:

Upgrade Cost
x4 → x8 1000
x8 → x16 3500
x16 → x32 7000
x32 → x64 18000

These values are only examples.

Adjust them to match your server economy.


Best Practices

Recommended practices:

  • Keep upgrade paths simple.
  • Use a clear progression.
  • Make larger upgrades more expensive.
  • Use permissions for large protection sizes.
  • Test overlap checks before release.
  • Test upgrades after changing stones.yml.
  • Test economy behavior before production use.
  • Keep backups before changing protection tiers.
  • Avoid removing or renaming stone IDs that are already used by existing protections.

Changing Upgrade Paths

Be careful when changing upgrade paths on a live server.

Changing stone IDs, upgrade paths or radii may affect existing protections.

Before major changes:

  1. Stop the server.
  2. Back up the server.
  3. Back up the LederProtections folder.
  4. Edit stones.yml.
  5. Start the server.
  6. Run /lep check.
  7. Test /p.
  8. Test one upgrade carefully.

Common Issues

The upgrade button does not appear

Check that:

  • the current stone has an upgrade path;
  • upgrades are enabled for that stone;
  • the player has permission;
  • the protection is already at the final tier.

The upgrade fails

Check that:

  • the next stone exists;
  • the player has permission for the next stone;
  • the player has enough money if cost is enabled;
  • the larger area does not overlap another protection;
  • WorldGuard and WorldEdit are working correctly.

Money is not taken

Check that:

  • Vault is installed;
  • an economy plugin is installed;
  • upgrade cost is configured;
  • economy support is enabled;
  • the player has enough money.

Money is taken but the upgrade fails

This should not happen.

If it happens, check:

  • console errors;
  • economy plugin behavior;
  • WorldGuard errors;
  • save errors;
  • whether the server is using the latest LederProtections version.

Please report the issue with reproduction steps if it happens.


The physical stone does not change

Check that:

  • physical stone updates are enabled if configurable;
  • the next stone has a valid material;
  • the block location still contains the expected protection stone;
  • there are no console errors.

Recommended Next Pages

Clone this wiki locally