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