mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-22 18:16:26 +01:00
Fix renamed entities stacked back instantly
This commit is contained in:
parent
02a605b3cd
commit
949f0de5d8
@ -148,6 +148,10 @@ public class StackingTask extends BukkitRunnable {
|
||||
if (!configurationSection.getBoolean("Mobs." + entity.getType().name() + ".Enabled"))
|
||||
return true;
|
||||
|
||||
//Check nametag or custom entity
|
||||
if ((!stackManager.isStackedEntity(entity) && entity.getCustomName() != null) || plugin.getCustomEntityManager().getCustomEntity(entity) != null)
|
||||
return true;
|
||||
|
||||
// Allow spawn if stack reasons are set and match, or if from a spawner
|
||||
final String spawnReason = entity.hasMetadata("US_REASON") && !entity.getMetadata("US_REASON").isEmpty()
|
||||
? entity.getMetadata("US_REASON").get(0).asString() : null;
|
||||
@ -186,12 +190,6 @@ public class StackingTask extends BukkitRunnable {
|
||||
return;
|
||||
}
|
||||
|
||||
// If this entity is named or a custom entity skip it.
|
||||
if (!isStack && (baseEntity.getCustomName() != null && plugin.getCustomEntityManager().getCustomEntity(baseEntity) != null)) {
|
||||
processed.add(baseEntity.getUniqueId());
|
||||
return;
|
||||
}
|
||||
|
||||
// Get similar entities around our entity and make sure those entities are both compatible and stackable.
|
||||
List<LivingEntity> stackableFriends = getSimilarEntitiesAroundEntity(baseEntity, location);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user