TamingManager.java 21 KB

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