mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 03:25:24 +01:00
Added allow-tamed-spawns setting, on by default.
This will stop WorldGuard from culling tamed animals in regions with mob-spawning deny when they log in with their owner.
This commit is contained in:
parent
1095064c5e
commit
d1e7796f81
@ -130,6 +130,7 @@ public class WorldConfiguration {
|
||||
public boolean highFreqFlags;
|
||||
public int regionWand;
|
||||
public Set<EntityType> blockCreatureSpawn;
|
||||
public boolean allowTamedSpawns;
|
||||
// public boolean useiConomy;
|
||||
// public boolean buyOnClaim;
|
||||
// public double buyOnClaimPrice;
|
||||
@ -356,6 +357,7 @@ private void loadConfiguration() {
|
||||
blockFireballExplosions = getBoolean("mobs.block-fireball-explosions", false);
|
||||
blockFireballBlockDamage = getBoolean("mobs.block-fireball-block-damage", false);
|
||||
antiWolfDumbness = getBoolean("mobs.anti-wolf-dumbness", false);
|
||||
allowTamedSpawns = getBoolean("mobs.allow-tamed-spawns", true);
|
||||
disableEndermanGriefing = getBoolean("mobs.disable-enderman-griefing", false);
|
||||
disableSnowmanTrails = getBoolean("mobs.disable-snowman-trails", false);
|
||||
blockEntityPaintingDestroy = getBoolean("mobs.block-painting-destroy", false);
|
||||
|
@ -761,8 +761,15 @@ 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)
|
||||
if (!wcfg.blockPluginSpawning && event.getSpawnReason() == CreatureSpawnEvent.SpawnReason.CUSTOM) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (wcfg.allowTamedSpawns
|
||||
&& event.getEntity() instanceof Tameable // nullsafe check
|
||||
&& ((Tameable) event.getEntity()).isTamed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityType entityType = event.getEntityType();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user