mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-10-04 17:47:41 +02:00
Added configuration option to allow plugin creature spawns
This commit is contained in:
parent
0fed35a80f
commit
9b17fe68e7
@ -98,6 +98,7 @@ public class WorldConfiguration {
|
||||
public boolean blockFireballExplosions;
|
||||
public boolean blockFireballBlockDamage;
|
||||
public boolean blockEntityPaintingDestroy;
|
||||
public boolean blockPluginSpawning;
|
||||
public boolean disableContactDamage;
|
||||
public boolean disableFallDamage;
|
||||
public boolean disableLavaDamage;
|
||||
@ -315,6 +316,7 @@ private void loadConfiguration() {
|
||||
antiWolfDumbness = getBoolean("mobs.anti-wolf-dumbness", false);
|
||||
disableEndermanGriefing = getBoolean("mobs.disable-enderman-griefing", false);
|
||||
blockEntityPaintingDestroy = getBoolean("mobs.block-painting-destroy", false);
|
||||
blockPluginSpawning = getBoolean("mobs.block-plugin-spawning", true);
|
||||
|
||||
disableFallDamage = getBoolean("player-damage.disable-fall-damage", false);
|
||||
disableLavaDamage = getBoolean("player-damage.disable-lava-damage", false);
|
||||
|
@ -610,6 +610,11 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
}
|
||||
|
||||
WorldConfiguration wcfg = cfg.get(event.getEntity().getWorld());
|
||||
|
||||
// allow spawning of creatures from plugins
|
||||
if (!wcfg.blockPluginSpawning && event.getSpawnReason() == CreatureSpawnEvent.SpawnReason.CUSTOM)
|
||||
return;
|
||||
|
||||
EntityType entityType = event.getEntityType();
|
||||
|
||||
if (wcfg.blockCreatureSpawn.contains(entityType)) {
|
||||
|
Loading…
Reference in New Issue
Block a user