mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Don't need this here
This commit is contained in:
parent
ebeebbde72
commit
3422c5d3eb
@ -4,18 +4,13 @@ import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||
|
||||
@ -23,18 +18,11 @@ public class TrackedTamingEntity extends BukkitRunnable {
|
||||
private LivingEntity livingEntity;
|
||||
private UUID id;
|
||||
private int length;
|
||||
private Player owner;
|
||||
|
||||
protected TrackedTamingEntity(LivingEntity livingEntity) {
|
||||
this.livingEntity = livingEntity;
|
||||
this.id = livingEntity.getUniqueId();
|
||||
|
||||
AnimalTamer tamer = ((Tameable)livingEntity).getOwner();
|
||||
|
||||
if (tamer != null && tamer instanceof Player) {
|
||||
this.owner = (Player) tamer;
|
||||
}
|
||||
|
||||
int tamingCOTWLength = Config.getInstance().getTamingCOTWLength(livingEntity.getType());
|
||||
|
||||
if (tamingCOTWLength > 0) {
|
||||
@ -52,14 +40,7 @@ public class TrackedTamingEntity extends BukkitRunnable {
|
||||
CombatUtils.dealDamage(livingEntity, livingEntity.getMaxHealth(), DamageCause.SUICIDE, livingEntity);
|
||||
}
|
||||
|
||||
if (!UserManager.hasPlayerDataKey(owner)) {
|
||||
return;
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(owner);
|
||||
TamingManager tamingManager = mcMMOPlayer.getTamingManager();
|
||||
|
||||
tamingManager.removeFromTracker(this);
|
||||
TamingManager.removeFromTracker(this);
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user