mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Converting entity tracking to use Bukkit metadata. Should greatly reduce lag on chunk loading and unloading.
This commit is contained in:
@ -67,7 +67,7 @@ public class CallOfTheWildEventHandler {
|
||||
return;
|
||||
|
||||
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);
|
||||
mcMMO.placeStore.addSpawnedPet(entity);
|
||||
entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.entityMetadata);
|
||||
|
||||
((Tameable) entity).setOwner(player);
|
||||
|
||||
|
@ -27,7 +27,10 @@ public class TamingManager extends SkillManager {
|
||||
* @param event The event to award XP for
|
||||
*/
|
||||
public void awardTamingXP(EntityTameEvent event) {
|
||||
if (mcMMO.placeStore.isSpawnedMob(event.getEntity())) {
|
||||
if (event.getEntity() == null) {
|
||||
return;
|
||||
}
|
||||
else if (event.getEntity().hasMetadata(mcMMO.entityMetadataKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user