TamingManager.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. package com.gmail.nossr50.skills.taming;
  2. import com.gmail.nossr50.config.experience.ExperienceConfig;
  3. import com.gmail.nossr50.datatypes.experience.XPGainReason;
  4. import com.gmail.nossr50.datatypes.interactions.NotificationType;
  5. import com.gmail.nossr50.datatypes.player.McMMOPlayer;
  6. import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
  7. import com.gmail.nossr50.datatypes.skills.SubSkillType;
  8. import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
  9. import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
  10. import com.gmail.nossr50.locale.LocaleLoader;
  11. import com.gmail.nossr50.mcMMO;
  12. import com.gmail.nossr50.metadata.MobMetaFlagType;
  13. import com.gmail.nossr50.skills.SkillManager;
  14. import com.gmail.nossr50.util.Misc;
  15. import com.gmail.nossr50.util.Permissions;
  16. import com.gmail.nossr50.util.player.NotificationManager;
  17. import com.gmail.nossr50.util.random.ProbabilityUtil;
  18. import com.gmail.nossr50.util.skills.ParticleEffectUtils;
  19. import com.gmail.nossr50.util.skills.RankUtils;
  20. import com.gmail.nossr50.util.sounds.SoundManager;
  21. import com.gmail.nossr50.util.sounds.SoundType;
  22. import com.gmail.nossr50.util.text.StringUtils;
  23. import org.bukkit.Location;
  24. import org.bukkit.Material;
  25. import org.bukkit.attribute.Attribute;
  26. import org.bukkit.attribute.AttributeInstance;
  27. import org.bukkit.entity.*;
  28. import org.bukkit.inventory.ItemStack;
  29. import org.jetbrains.annotations.NotNull;
  30. import java.util.HashMap;
  31. import static com.gmail.nossr50.util.MobMetadataUtils.flagMetadata;
  32. public class TamingManager extends SkillManager {
  33. //TODO: Temporary static cache, will be changed in 2.2
  34. private static HashMap<Material, CallOfTheWildType> summoningItems;
  35. private static HashMap<CallOfTheWildType, TamingSummon> cotwSummonDataProperties;
  36. private long lastSummonTimeStamp;
  37. public TamingManager(@NotNull McMMOPlayer mcMMOPlayer) {
  38. super(mcMMOPlayer, PrimarySkillType.TAMING);
  39. init();
  40. }
  41. //TODO: Hacky stuff for 2.1, will be cleaned up in 2.2
  42. private void init() {
  43. //prevents accidentally summoning too many things when holding down left click
  44. lastSummonTimeStamp = 0L;
  45. //Init per-player tracking of summoned entities
  46. mcMMO.getTransientEntityTracker().initPlayer(mmoPlayer.getPlayer());
  47. //Hacky stuff used as a band-aid
  48. initStaticCaches();
  49. }
  50. private void initStaticCaches() {
  51. //TODO: Temporary static cache, will be changed in 2.2
  52. //This is shared between instances of TamingManager
  53. if (summoningItems == null) {
  54. summoningItems = new HashMap<>();
  55. summoningItems.put(mcMMO.p.getGeneralConfig().getTamingCOTWMaterial(CallOfTheWildType.CAT.getConfigEntityTypeEntry()), CallOfTheWildType.CAT);
  56. summoningItems.put(mcMMO.p.getGeneralConfig().getTamingCOTWMaterial(CallOfTheWildType.WOLF.getConfigEntityTypeEntry()), CallOfTheWildType.WOLF);
  57. summoningItems.put(mcMMO.p.getGeneralConfig().getTamingCOTWMaterial(CallOfTheWildType.HORSE.getConfigEntityTypeEntry()), CallOfTheWildType.HORSE);
  58. }
  59. //TODO: Temporary static cache, will be changed in 2.2
  60. //This is shared between instances of TamingManager
  61. if (cotwSummonDataProperties == null) {
  62. cotwSummonDataProperties = new HashMap<>();
  63. for(CallOfTheWildType callOfTheWildType : CallOfTheWildType.values()) {
  64. Material itemSummonMaterial = mcMMO.p.getGeneralConfig().getTamingCOTWMaterial(callOfTheWildType.getConfigEntityTypeEntry());
  65. int itemAmountRequired = mcMMO.p.getGeneralConfig().getTamingCOTWCost(callOfTheWildType.getConfigEntityTypeEntry());
  66. int entitiesSummonedPerCOTW = mcMMO.p.getGeneralConfig().getTamingCOTWAmount(callOfTheWildType.getConfigEntityTypeEntry());
  67. int summonLifespanSeconds = mcMMO.p.getGeneralConfig().getTamingCOTWLength(callOfTheWildType.getConfigEntityTypeEntry());
  68. int perPlayerMaxAmount = mcMMO.p.getGeneralConfig().getTamingCOTWMaxAmount(callOfTheWildType.getConfigEntityTypeEntry());
  69. TamingSummon tamingSummon = new TamingSummon(callOfTheWildType, itemSummonMaterial, itemAmountRequired, entitiesSummonedPerCOTW, summonLifespanSeconds, perPlayerMaxAmount);
  70. cotwSummonDataProperties.put(callOfTheWildType, tamingSummon);
  71. }
  72. }
  73. }
  74. public boolean canUseThickFur() {
  75. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_THICK_FUR)
  76. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_THICK_FUR);
  77. }
  78. public boolean canUseEnvironmentallyAware() {
  79. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE)
  80. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
  81. }
  82. public boolean canUseShockProof() {
  83. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_SHOCK_PROOF)
  84. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHOCK_PROOF);
  85. }
  86. public boolean canUseHolyHound() {
  87. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE)
  88. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_HOLY_HOUND);
  89. }
  90. public boolean canUseFastFoodService() {
  91. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_FAST_FOOD_SERVICE)
  92. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_FAST_FOOD_SERVICE);
  93. }
  94. public boolean canUseSharpenedClaws() {
  95. return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS)
  96. && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS);
  97. }
  98. public boolean canUseGore() {
  99. if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE))
  100. return false;
  101. return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_GORE);
  102. }
  103. public boolean canUseBeastLore() {
  104. if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE))
  105. return false;
  106. return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_BEAST_LORE);
  107. }
  108. /**
  109. * Award XP for taming.
  110. *
  111. * @param entity The LivingEntity to award XP for
  112. */
  113. public void awardTamingXP(@NotNull LivingEntity entity) {
  114. applyXpGain(ExperienceConfig.getInstance().getTamingXP(entity.getType()), XPGainReason.PVE);
  115. }
  116. /**
  117. * Apply the Fast Food Service ability.
  118. *
  119. * @param wolf The wolf using the ability
  120. * @param damage The damage being absorbed by the wolf
  121. */
  122. public void fastFoodService(@NotNull Wolf wolf, double damage) {
  123. if (!ProbabilityUtil.isSkillRNGSuccessful(SubSkillType.TAMING_FAST_FOOD_SERVICE, mmoPlayer)) {
  124. return;
  125. }
  126. double health = wolf.getHealth();
  127. double maxHealth = wolf.getMaxHealth();
  128. if (health < maxHealth) {
  129. double newHealth = health + damage;
  130. wolf.setHealth(Math.min(newHealth, maxHealth));
  131. }
  132. }
  133. /**
  134. * Apply the Gore ability.
  135. *
  136. * @param target The LivingEntity to apply Gore on
  137. * @param damage The initial damage
  138. */
  139. public double gore(@NotNull LivingEntity target, double damage) {
  140. damage = (damage * Taming.goreModifier) - damage;
  141. return damage;
  142. }
  143. public double sharpenedClaws() {
  144. return Taming.sharpenedClawsBonusDamage;
  145. }
  146. /**
  147. * Summon an ocelot to your side.
  148. */
  149. public void summonOcelot() {
  150. if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
  151. return;
  152. if (!Permissions.callOfTheWild(getPlayer(), EntityType.OCELOT)) {
  153. return;
  154. }
  155. processCallOfTheWild();
  156. }
  157. /**
  158. * Summon a wolf to your side.
  159. */
  160. public void summonWolf() {
  161. if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
  162. return;
  163. if (!Permissions.callOfTheWild(getPlayer(), EntityType.WOLF)) {
  164. return;
  165. }
  166. processCallOfTheWild();
  167. }
  168. /**
  169. * Summon a horse to your side.
  170. */
  171. public void summonHorse() {
  172. if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD))
  173. return;
  174. if (!Permissions.callOfTheWild(getPlayer(), EntityType.HORSE)) {
  175. return;
  176. }
  177. processCallOfTheWild();
  178. }
  179. /**
  180. * Handle the Beast Lore ability.
  181. *
  182. * @param target The entity to examine
  183. */
  184. public void beastLore(LivingEntity target) {
  185. Player player = getPlayer();
  186. Tameable beast = (Tameable) target;
  187. String message = LocaleLoader.getString("Combat.BeastLore") + " ";
  188. if (beast.isTamed() && beast.getOwner() != null) {
  189. message = message.concat(LocaleLoader.getString("Combat.BeastLoreOwner", beast.getOwner().getName()) + " ");
  190. }
  191. message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", target.getHealth(), target.getMaxHealth()));
  192. // Bred mules & donkeys can actually have horse-like stats, but llamas cannot.
  193. if (beast instanceof AbstractHorse horseLikeCreature && !(beast instanceof Llama)) {
  194. AttributeInstance jumpAttribute = horseLikeCreature.getAttribute(mcMMO.p.getAttributeMapper().getHorseJumpStrength());
  195. if (jumpAttribute != null) {
  196. double jumpStrength = jumpAttribute.getValue();
  197. // Taken from https://minecraft.wiki/w/Horse#Jump_strength
  198. jumpStrength = -0.1817584952 * Math.pow(jumpStrength, 3) + 3.689713992 * Math.pow(jumpStrength, 2) + 2.128599134 * jumpStrength - 0.343930367;
  199. message = message.concat("\n" + LocaleLoader.getString("Combat.BeastLoreHorseSpeed", horseLikeCreature.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getValue() * 43))
  200. .concat("\n" + LocaleLoader.getString("Combat.BeastLoreHorseJumpStrength", jumpStrength));
  201. }
  202. }
  203. player.sendMessage(message);
  204. }
  205. public void processEnvironmentallyAware(@NotNull Wolf wolf, double damage) {
  206. if (damage > wolf.getHealth()) {
  207. return;
  208. }
  209. Player owner = getPlayer();
  210. wolf.teleport(owner);
  211. NotificationManager.sendPlayerInformation(owner, NotificationType.SUBSKILL_MESSAGE, "Taming.Listener.Wolf");
  212. }
  213. public void pummel(LivingEntity target, Wolf wolf) {
  214. if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL))
  215. return;
  216. if (!ProbabilityUtil.isStaticSkillRNGSuccessful(PrimarySkillType.TAMING, mmoPlayer, mcMMO.p.getAdvancedConfig().getPummelChance()))
  217. return;
  218. ParticleEffectUtils.playGreaterImpactEffect(target);
  219. target.setVelocity(wolf.getLocation().getDirection().normalize().multiply(1.5D));
  220. if (target instanceof Player defender) {
  221. if (NotificationManager.doesPlayerUseNotifications(defender)) {
  222. NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Taming.SubSkill.Pummel.TargetMessage");
  223. }
  224. }
  225. }
  226. public void attackTarget(LivingEntity target) {
  227. if (target instanceof Tameable tameable) {
  228. if (tameable.getOwner() == getPlayer()) {
  229. return;
  230. }
  231. }
  232. double range = 5;
  233. Player player = getPlayer();
  234. if (!target.getWorld().equals(player.getWorld()))
  235. return;
  236. for (Entity entity : player.getNearbyEntities(range, range, range)) {
  237. if (entity.getType() != EntityType.WOLF) {
  238. continue;
  239. }
  240. Wolf wolf = (Wolf) entity;
  241. if (!wolf.isTamed() || (wolf.getOwner() != player) || wolf.isSitting()) {
  242. continue;
  243. }
  244. wolf.setTarget(target);
  245. }
  246. }
  247. private void processCallOfTheWild() {
  248. //Prevent summoning too many things accidentally if a player holds down the button
  249. if (lastSummonTimeStamp + 150 > System.currentTimeMillis()) {
  250. return;
  251. } else {
  252. lastSummonTimeStamp = System.currentTimeMillis();
  253. }
  254. Player player = getPlayer();
  255. ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
  256. //Check if the item the player is currently holding is a COTW item
  257. if (isCOTWItem(itemInMainHand)) {
  258. //Get the summoning type
  259. CallOfTheWildType callOfTheWildType = summoningItems.get(itemInMainHand.getType());
  260. TamingSummon tamingSummon = cotwSummonDataProperties.get(callOfTheWildType);
  261. //Players will pay for the cost if at least one thing was summoned
  262. int amountSummoned = 0;
  263. //Check to see if players have the correct amount of the item required to summon
  264. if (itemInMainHand.getAmount() >= tamingSummon.getItemAmountRequired()) {
  265. //Initial Spawn location
  266. Location spawnLocation = Misc.getLocationOffset(player.getLocation(), 1);
  267. //COTW can summon multiple entities per usage
  268. for (int i = 0; i < tamingSummon.getEntitiesSummoned(); i++) {
  269. if (getAmountCurrentlySummoned(callOfTheWildType) >= tamingSummon.getSummonCap()) {
  270. NotificationManager.sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.Limit",
  271. String.valueOf(tamingSummon.getSummonCap()),
  272. StringUtils.getCapitalized(callOfTheWildType.toString()));
  273. break;
  274. }
  275. spawnLocation = Misc.getLocationOffset(spawnLocation, 1);
  276. spawnCOTWEntity(callOfTheWildType, spawnLocation, tamingSummon.getEntityType());
  277. //Inform the player about what they have just done
  278. if (tamingSummon.getSummonLifespan() > 0) {
  279. NotificationManager.sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.Success.WithLifespan",
  280. StringUtils.getCapitalized(callOfTheWildType.toString()), String.valueOf(tamingSummon.getSummonLifespan()));
  281. } else {
  282. NotificationManager.sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.Success.WithoutLifespan", StringUtils.getCapitalized(callOfTheWildType.toString()));
  283. }
  284. //Send Sound
  285. SoundManager.sendSound(player, player.getLocation(), SoundType.ABILITY_ACTIVATED_GENERIC);
  286. amountSummoned++;
  287. }
  288. //Remove items from the player if they had at least one entity summoned successfully
  289. if (amountSummoned >= 1) {
  290. //Remove the items used to summon
  291. int itemAmountAfterPayingCost = itemInMainHand.getAmount() - tamingSummon.getItemAmountRequired();
  292. itemInMainHand.setAmount(itemAmountAfterPayingCost);
  293. player.updateInventory();
  294. }
  295. } else {
  296. //Player did not have enough of the item in their main hand
  297. int difference = tamingSummon.getItemAmountRequired() - itemInMainHand.getAmount();
  298. NotificationManager.sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.NeedMoreItems", String.valueOf(difference), StringUtils.getPrettyItemString(itemInMainHand.getType()));
  299. }
  300. }
  301. }
  302. private void spawnCOTWEntity(CallOfTheWildType callOfTheWildType, Location spawnLocation, EntityType entityType) {
  303. switch (callOfTheWildType) {
  304. case CAT ->
  305. //Entity type is needed for cats because in 1.13 and below we spawn ocelots, in 1.14 and above we spawn cats
  306. spawnCat(spawnLocation, entityType);
  307. case HORSE -> spawnHorse(spawnLocation);
  308. case WOLF -> spawnWolf(spawnLocation);
  309. }
  310. }
  311. private void spawnWolf(Location spawnLocation) {
  312. LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, EntityType.WOLF);
  313. //This is used to prevent XP gains for damaging this entity
  314. applyMetaDataToCOTWEntity(callOfWildEntity);
  315. setBaseCOTWEntityProperties(callOfWildEntity);
  316. ((Wolf) callOfWildEntity).setAdult();
  317. addToTracker(callOfWildEntity, CallOfTheWildType.WOLF);
  318. //Setup wolf stats
  319. callOfWildEntity.setMaxHealth(20.0);
  320. callOfWildEntity.setHealth(callOfWildEntity.getMaxHealth());
  321. callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.WOLF)));
  322. }
  323. private void spawnCat(Location spawnLocation, EntityType entityType) {
  324. LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, entityType);
  325. //This is used to prevent XP gains for damaging this entity
  326. applyMetaDataToCOTWEntity(callOfWildEntity);
  327. setBaseCOTWEntityProperties(callOfWildEntity);
  328. addToTracker(callOfWildEntity, CallOfTheWildType.CAT);
  329. //Randomize the cat
  330. if (callOfWildEntity instanceof Ocelot) {
  331. int numberOfTypes = Ocelot.Type.values().length;
  332. ((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]);
  333. ((Ocelot) callOfWildEntity).setAdult();
  334. } else if (callOfWildEntity instanceof Cat) {
  335. int numberOfTypes = Cat.Type.values().length;
  336. ((Cat) callOfWildEntity).setCatType(Cat.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]);
  337. ((Cat) callOfWildEntity).setAdult();
  338. }
  339. callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(entityType)));
  340. //Particle effect
  341. ParticleEffectUtils.playCallOfTheWildEffect(callOfWildEntity);
  342. }
  343. private void spawnHorse(Location spawnLocation) {
  344. LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, EntityType.HORSE);
  345. applyMetaDataToCOTWEntity(callOfWildEntity);
  346. setBaseCOTWEntityProperties(callOfWildEntity);
  347. addToTracker(callOfWildEntity, CallOfTheWildType.HORSE);
  348. //Randomize Horse
  349. Horse horse = (Horse) callOfWildEntity;
  350. callOfWildEntity.setMaxHealth(15.0 + (Misc.getRandom().nextDouble() * 15));
  351. callOfWildEntity.setHealth(callOfWildEntity.getMaxHealth());
  352. horse.setColor(Horse.Color.values()[Misc.getRandom().nextInt(Horse.Color.values().length)]);
  353. horse.setStyle(Horse.Style.values()[Misc.getRandom().nextInt(Horse.Style.values().length)]);
  354. horse.setJumpStrength(Math.max(mcMMO.p.getAdvancedConfig().getMinHorseJumpStrength(), Math.min(Math.min(Misc.getRandom().nextDouble(), Misc.getRandom().nextDouble()) * 2, mcMMO.p.getAdvancedConfig().getMaxHorseJumpStrength())));
  355. horse.setAdult();
  356. //TODO: setSpeed, once available
  357. callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.HORSE)));
  358. //Particle effect
  359. ParticleEffectUtils.playCallOfTheWildEffect(callOfWildEntity);
  360. }
  361. private void setBaseCOTWEntityProperties(LivingEntity callOfWildEntity) {
  362. ((Tameable) callOfWildEntity).setOwner(getPlayer());
  363. callOfWildEntity.setRemoveWhenFarAway(false);
  364. }
  365. private void applyMetaDataToCOTWEntity(LivingEntity summonedEntity) {
  366. //This helps identify the entity as being summoned by COTW
  367. flagMetadata(MobMetaFlagType.COTW_SUMMONED_MOB, summonedEntity);
  368. }
  369. /**
  370. * Whether the itemstack is used for COTW
  371. * @param itemStack target ItemStack
  372. * @return true if it is used for any COTW
  373. */
  374. public boolean isCOTWItem(@NotNull ItemStack itemStack) {
  375. return summoningItems.containsKey(itemStack.getType());
  376. }
  377. private int getAmountCurrentlySummoned(@NotNull CallOfTheWildType callOfTheWildType) {
  378. return mcMMO.getTransientEntityTracker().getAmountCurrentlySummoned(getPlayer().getUniqueId(), callOfTheWildType);
  379. }
  380. private void addToTracker(@NotNull LivingEntity livingEntity, @NotNull CallOfTheWildType callOfTheWildType) {
  381. mcMMO.getTransientEntityTracker().registerEntity(getPlayer().getUniqueId(), new TrackedTamingEntity(livingEntity, callOfTheWildType, getPlayer()));
  382. }
  383. /**
  384. * Remove all tracked entities from existence if they currently exist
  385. * Clear the tracked entity lists afterwards
  386. */
  387. //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update
  388. public void cleanupAllSummons() {
  389. mcMMO.getTransientEntityTracker().cleanupPlayer(getPlayer());
  390. }
  391. }