mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
[Feature] Add a blacklist for what dispensers can dispense to antibuild
This commit is contained in:
parent
eeb31e054f
commit
f6e2db1eda
4 changed files with 16 additions and 2 deletions
|
@ -659,6 +659,9 @@ protect:
|
||||||
|
|
||||||
# Which blocks should not be pushed by pistons?
|
# Which blocks should not be pushed by pistons?
|
||||||
piston:
|
piston:
|
||||||
|
|
||||||
|
# Which blocks should not be dispensed by dispensers
|
||||||
|
dispenser:
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
|
|
|
@ -11,7 +11,8 @@ public enum AntiBuildConfig
|
||||||
blacklist_placement("protect.blacklist.placement"),
|
blacklist_placement("protect.blacklist.placement"),
|
||||||
blacklist_usage("protect.blacklist.usage"),
|
blacklist_usage("protect.blacklist.usage"),
|
||||||
blacklist_break("protect.blacklist.break"),
|
blacklist_break("protect.blacklist.break"),
|
||||||
blacklist_piston("protect.blacklist.piston");
|
blacklist_piston("protect.blacklist.piston"),
|
||||||
|
blacklist_dispenser("protect.blacklist.dispenser");
|
||||||
private final String configName;
|
private final String configName;
|
||||||
private final String defValueString;
|
private final String defValueString;
|
||||||
private final boolean defValueBoolean;
|
private final boolean defValueBoolean;
|
||||||
|
|
|
@ -313,4 +313,14 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onBlockDispense(final BlockDispenseEvent event)
|
||||||
|
{
|
||||||
|
final ItemStack item = event.getItem();
|
||||||
|
if (prot.checkProtectionItems(AntiBuildConfig.blacklist_dispenser, item.getTypeId()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,5 +5,5 @@ main: com.earth2me.essentials.antibuild.EssentialsAntiBuild
|
||||||
version: TeamCity
|
version: TeamCity
|
||||||
website: http://tiny.cc/EssentialsCommands
|
website: http://tiny.cc/EssentialsCommands
|
||||||
description: Provides build protection.
|
description: Provides build protection.
|
||||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
|
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, Iaccidentally]
|
||||||
depend: [Essentials]
|
depend: [Essentials]
|
||||||
|
|
Loading…
Reference in a new issue