mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +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;
|
||||
}
|
||||
|
||||
|
@ -456,8 +456,8 @@ public final class CombatTools {
|
||||
baseXP = 20 * configInstance.getPlayerVersusPlayerXP();
|
||||
}
|
||||
}
|
||||
else if (!mcMMO.placeStore.isSpawnedMob(target)) {
|
||||
if (target instanceof Animals && !mcMMO.placeStore.isSpawnedPet(target)) {
|
||||
else if (!target.hasMetadata(mcMMO.entityMetadataKey)) {
|
||||
if (target instanceof Animals) {
|
||||
if (ModChecks.isCustomEntity(target)) {
|
||||
baseXP = ModChecks.getCustomEntity(target).getXpMultiplier();
|
||||
}
|
||||
|
Reference in New Issue
Block a user