Skip to content

Commit

Permalink
Added new config WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
espidev committed Apr 17, 2019
1 parent 74942ff commit 2f9c8a5
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/main/java/me/vik1395/ProtectionStones/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

public class Config {



public static void initConfig() {
ProtectionStones.config = new YamlConfiguration();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@

package me.vik1395.ProtectionStones;

import java.util.List;

public class ConfigProtectBlock {
private int regionX, regionY, regionZ, defaultPriority;
boolean autoHide, noDrop, blockPiston, silkTouch;
private boolean autoHide, noDrop, blockPiston, silkTouch, worldListOption;

private List<String> worlds;


/*
* Object to represent a protection block as defined in config ("Region" section)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/me/vik1395/ProtectionStones/FlagHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public static void initFlags() {
settings = settings.trim();

Flag<?> flag = Flags.fuzzyMatchFlag(WorldGuard.getInstance().getFlagRegistry(), split[0]);
System.out.printf("Set flag %s to %s\n", flag.getName(), settings);
try {
FlagContext fc = FlagContext.create().setInput(settings).build();
defaultFlags.put(flag, flag.parseInput(fc));
Expand Down
118 changes: 118 additions & 0 deletions src/main/resources/new_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Config Version: 3
UUIDUpdated: true

# ---------------------------------------------------------------------------------------
# Protection Stones Config
# Do not use tabs, you must use spaces when indenting in this file.
# ---------------------------------------------------------------------------------------

# Please do not change the config version unless you know what you are doing!

# Cooldown between placing protection blocks (in seconds). -1 to disable.
Placing Cooldown: -1

# Whether or not to allow the use of /ps admin cleanup|disown, etc.
# You should only enable this when you need
Allow Dangerous Commands: false

# **************************************************************************************************************

# Define your protection blocks below
# Use block names from here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
# In order to use settings from the "Defaults" section, simply write "default" in any field or simply remove it

Blocks:

# Simple example
EMERALD_ORE:


# **********************************************************************************************************
# More advanced example
GOLD_ORE:
# Whether or not to restrict obtaining of the protection stone to only /ps get and /ps give.
# Other ways to obtain this block (ex. mining) will not work as a protection stone.
# Useful to allow the protection block to only be obtained from a shop or command.
# Set to "false" if you want to allow players to obtain a protection stone naturally
Restrict Obtaining: true

# Enable or disable the use of this protection stone in specific worlds
# "blacklist" mode prevents this protect block from being used in the worlds in "worlds"
# "whitelist" mode allows this protect block to only be used in the worlds in "worlds"
World List Type: blacklist
Worlds:
- exampleworld1
- exampleworld2

Region:
# Protection radius of block
# Set y_radius to -1 if you want it to protect from sky to bedrock. If this doesn't appear to work set it to 256.
X Radius: 64
Y Radius: -1
Z Radius: 64

# How many blocks to offset the default location of /ps home from the protection block
Home X Offset: 0
Home Y Offset: 1
Home Z Offset: 0

# Specify the default flags to be set when a new protected region is created.
Flags:
- pvp deny
- greeting &lEntering &b&l%player%'s &r&lprotected area
- farewell &lLeaving &b&l%player%'s &r&lprotected area

# List all the flags that can be set by region owners. Separate them with a comma, no space.
Allowed Flags:
- use
- pvp
- greeting
- farewell
- mob-spawning

# Default priority type for this block type protection stone
Priority: 0

Block Data:
# Name given to protection block when obtained with /ps give or /ps get
# Leave as '' for no name
Display Name: '&a&m<---&r&6 64x64 Protection Stone &r&a&m--->'

# Lore given to protection block when obtained with /ps give or /ps get
# Leave as [] for no lore
Lore:
- '&6(⌐■_■)ノ♪ Nobody's going to touch my stuff!'

# Add price when using /ps get
# Must have compatible economy plugin (anything that uses Vault, ie. Essentials)
Price: 0

Behaviour:
# Hide protection stone right away when placed?
Auto Hide: false

# Disable returning the block when removed/unclaimed?
No Drop: false

# Prevents piston pushing of the block. Recommended to keep as true.
Prevent Piston Push: true

# Silk Touch: if true, ore-blocks that are also configured by ProtectionStones will disallow Silk Touch drops
# This was the old behaviour to prevent natural obtaining of the protection stone.
# Recommended to keep false if "Restrict Obtaining" (the new way) is true
Silk Touch: false

Player:
# Whether or not to prevent any sort of teleporting into the protected region
Prevent Teleport In: false

# Can't move for x seconds before teleporting with /ps home or /ps tp. Can be disabled with -1.
# Option to teleport only if player stands still.
# Can override with permission protectionstones.tp.bypasswait
Teleport Wait:
No Moving: true
Seconds: -1

# Extra permission required to place protection block (you still need protectionstones.create)
# '' for no extra permission
Permission: 'protectionstones.create.gold'

0 comments on commit 2f9c8a5

Please sign in to comment.