Added option to prerequisite for always fail
This commit is contained in:
parent
a2e4ba1c9d
commit
3fe40117c6
@ -12,6 +12,8 @@ break:
|
||||
break-prerequisite:
|
||||
# 'unknown' means we dont know where the spawner came from (usually a generated one or e.g. using worldedit)
|
||||
UNKNOWN:
|
||||
# If a spawner can be broken at all (displays fail-message if set)
|
||||
canBreak: true
|
||||
# Which items are allowed to break a spawner (null to allow everything)
|
||||
allowed-items:
|
||||
- 'diamond_pickaxe'
|
||||
@ -24,6 +26,7 @@ break:
|
||||
fail: '§7§oNothing happens, it seems you need a diamond-pickaxe with silktouch'
|
||||
|
||||
PLAYER:
|
||||
canBreak: true
|
||||
allowed-items:
|
||||
- 'diamond_pickaxe'
|
||||
silktouch: true
|
||||
@ -32,6 +35,7 @@ break:
|
||||
fail: '§7§oNothing happens, it seems you need a diamond-pickaxe with silktouch'
|
||||
|
||||
ADMIN:
|
||||
canBreak: true
|
||||
allowed-items:
|
||||
- 'diamond_pickaxe'
|
||||
silktouch: true
|
||||
@ -49,6 +53,8 @@ break:
|
||||
drop-prerequisite:
|
||||
|
||||
UNKNOWN:
|
||||
# If a spawner ever drops the item (displays fail-message if set)
|
||||
willDrop: true
|
||||
allowed-items:
|
||||
- 'diamond_pickaxe'
|
||||
silktouch: true
|
||||
@ -57,6 +63,7 @@ break:
|
||||
fail: '§7§o*Poof* The spawner breaks into many pieces and is lost'
|
||||
|
||||
PLAYER:
|
||||
willDrop: true
|
||||
allowed-items:
|
||||
- 'diamond_pickaxe'
|
||||
silktouch: true
|
||||
@ -65,6 +72,7 @@ break:
|
||||
fail: '§7§o*Poof* The spawner breaks into many pieces and is lost'
|
||||
|
||||
ADMIN:
|
||||
willDrop: true
|
||||
allowed-items:
|
||||
- 'diamond_pickaxe'
|
||||
silktouch: true
|
||||
|
@ -47,9 +47,14 @@ public class OnBlockBreak implements Listener {
|
||||
// # Break-Prerequisite
|
||||
ConfigurationSection breakPreConfig = Main.config.getConfigurationSection("break.break-prerequisite."+ bSource);
|
||||
boolean success = true;
|
||||
|
||||
// CanBreak
|
||||
if(!breakPreConfig.getBoolean("canBreak"))
|
||||
success = false;
|
||||
|
||||
// Allowed-items
|
||||
List<String> allowed_items = (List<String>) breakPreConfig.getList("allowed-items");
|
||||
if(allowed_items != null){
|
||||
if(success && allowed_items != null){
|
||||
boolean found = false;
|
||||
for(String allowed_item : allowed_items){
|
||||
if(p.getItemInHand().getType().name().equalsIgnoreCase(allowed_item)){
|
||||
@ -95,6 +100,11 @@ public class OnBlockBreak implements Listener {
|
||||
// # Drop-Prerequisite
|
||||
ConfigurationSection dropPreConfig = Main.config.getConfigurationSection("break.drop-prerequisite."+ bSource);
|
||||
boolean success = true;
|
||||
|
||||
// WillDrop
|
||||
if(!dropPreConfig.getBoolean("willDrop"))
|
||||
success = false;
|
||||
|
||||
// Allowed-items
|
||||
List<String> allowed_items = (List<String>) dropPreConfig.getList("allowed-items");
|
||||
if(allowed_items != null){
|
||||
|
Loading…
x
Reference in New Issue
Block a user