mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 01:03:44 +01:00 
			
		
		
		
	Merge remote-tracking branch 'origin/master'
This commit is contained in:
		| @@ -1,3 +1,9 @@ | |||||||
|  | Version 2.2.022 | ||||||
|  |     Fixed a bug where Roll was always reducing damage (thanks Ineusia) | ||||||
|  |     Fix COTW errors on older versions (thanks Warriorrrr) | ||||||
|  |     Fixed slimes spawning from slime division not inheriting tags. (thanks Ineusia) | ||||||
|  |  | ||||||
|  |  | ||||||
| Version 2.2.021 | Version 2.2.021 | ||||||
|     Fixed issue where Roll wasn't reducing as much damage as it should have been (thanks Ineusia) |     Fixed issue where Roll wasn't reducing as much damage as it should have been (thanks Ineusia) | ||||||
|     Updated locale_es (thanks Devilcasters) |     Updated locale_es (thanks Devilcasters) | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | |||||||
|     <modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
|     <groupId>com.gmail.nossr50.mcMMO</groupId> |     <groupId>com.gmail.nossr50.mcMMO</groupId> | ||||||
|     <artifactId>mcMMO</artifactId> |     <artifactId>mcMMO</artifactId> | ||||||
|     <version>2.2.021</version> |     <version>2.2.023-SNAPSHOT</version> | ||||||
|     <name>mcMMO</name> |     <name>mcMMO</name> | ||||||
|     <url>https://github.com/mcMMO-Dev/mcMMO</url> |     <url>https://github.com/mcMMO-Dev/mcMMO</url> | ||||||
|     <scm> |     <scm> | ||||||
|   | |||||||
| @@ -77,6 +77,8 @@ public class Roll extends AcrobaticsSubSkill { | |||||||
|                     return false; |                     return false; | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|  |                 // Roll happened, reduce damage, send messages and XP | ||||||
|  |                 if (rollResult.isRollSuccess()) { | ||||||
|                     // Clear out the damage from falling so that way our modified damage doesn't get re-reduced by protection/feather falling |                     // Clear out the damage from falling so that way our modified damage doesn't get re-reduced by protection/feather falling | ||||||
|                     entityDamageEvent.setDamage(0); |                     entityDamageEvent.setDamage(0); | ||||||
|                     // Send the damage is MAGIC so that it cuts through all resistances |                     // Send the damage is MAGIC so that it cuts through all resistances | ||||||
| @@ -87,8 +89,6 @@ public class Roll extends AcrobaticsSubSkill { | |||||||
|                         entityDamageEvent.setCancelled(true); |                         entityDamageEvent.setCancelled(true); | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|                 // Roll happened, send messages and XP |  | ||||||
|                 if (rollResult.isRollSuccess()) { |  | ||||||
|                     final String key |                     final String key | ||||||
|                             = rollResult.isGraceful() ? GRACEFUL_ROLL_ACTIVATED_LOCALE_STR_KEY : ROLL_ACTIVATED_LOCALE_KEY; |                             = rollResult.isGraceful() ? GRACEFUL_ROLL_ACTIVATED_LOCALE_STR_KEY : ROLL_ACTIVATED_LOCALE_KEY; | ||||||
|                     sendPlayerInformation(mmoPlayer.getPlayer(), NotificationType.SUBSKILL_MESSAGE, key); |                     sendPlayerInformation(mmoPlayer.getPlayer(), NotificationType.SUBSKILL_MESSAGE, key); | ||||||
|   | |||||||
| @@ -45,6 +45,10 @@ import org.bukkit.potion.PotionEffect; | |||||||
| import org.bukkit.potion.PotionEffectType; | import org.bukkit.potion.PotionEffectType; | ||||||
| import org.bukkit.projectiles.ProjectileSource; | import org.bukkit.projectiles.ProjectileSource; | ||||||
|  |  | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Set; | ||||||
|  |  | ||||||
| import static com.gmail.nossr50.util.MobMetadataUtils.*; | import static com.gmail.nossr50.util.MobMetadataUtils.*; | ||||||
|  |  | ||||||
| public class EntityListener implements Listener { | public class EntityListener implements Listener { | ||||||
| @@ -55,6 +59,8 @@ public class EntityListener implements Listener { | |||||||
|      * check if a {@link Player} has a {@link Trident} enchanted with "Piercing". |      * check if a {@link Player} has a {@link Trident} enchanted with "Piercing". | ||||||
|      */ |      */ | ||||||
|     private final NamespacedKey piercingEnchantment = NamespacedKey.minecraft("piercing"); |     private final NamespacedKey piercingEnchantment = NamespacedKey.minecraft("piercing"); | ||||||
|  |     private final static Set<EntityType> TRANSFORMABLE_ENTITIES | ||||||
|  |             = Set.of(EntityType.SLIME, EntityType.MAGMA_CUBE); | ||||||
|  |  | ||||||
|     public EntityListener(final mcMMO pluginRef) { |     public EntityListener(final mcMMO pluginRef) { | ||||||
|         this.pluginRef = pluginRef; |         this.pluginRef = pluginRef; | ||||||
| @@ -72,6 +78,11 @@ public class EntityListener implements Listener { | |||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  |             // Clear the original slime/magma cubes metadata - it's dead. | ||||||
|  |             if (TRANSFORMABLE_ENTITIES.contains(livingEntity.getType())) { | ||||||
|  |                 mcMMO.getTransientMetadataTools().cleanLivingEntityMetadata(livingEntity); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -652,7 +663,14 @@ public class EntityListener implements Listener { | |||||||
|      */ |      */ | ||||||
|     @EventHandler(priority = EventPriority.LOWEST) |     @EventHandler(priority = EventPriority.LOWEST) | ||||||
|     public void onEntityDeathLowest(EntityDeathEvent event) { |     public void onEntityDeathLowest(EntityDeathEvent event) { | ||||||
|         mcMMO.getTransientMetadataTools().cleanLivingEntityMetadata(event.getEntity()); |         LivingEntity entity = event.getEntity(); | ||||||
|  |  | ||||||
|  |         // Clear metadata for Slimes/Magma Cubes after transformation events take place, otherwise small spawned slimes will not have any tags | ||||||
|  |         if (TRANSFORMABLE_ENTITIES.contains(entity.getType())) { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         mcMMO.getTransientMetadataTools().cleanLivingEntityMetadata(entity); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -402,6 +402,7 @@ public class TamingManager extends SkillManager { | |||||||
|         callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.WOLF))); |         callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.WOLF))); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @SuppressWarnings("deprecation") | ||||||
|     private void spawnCat(Location spawnLocation, EntityType entityType) { |     private void spawnCat(Location spawnLocation, EntityType entityType) { | ||||||
|         LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, entityType); |         LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, entityType); | ||||||
|  |  | ||||||
| @@ -414,15 +415,13 @@ public class TamingManager extends SkillManager { | |||||||
|  |  | ||||||
|         //Randomize the cat |         //Randomize the cat | ||||||
|         if (callOfWildEntity instanceof Ocelot) { |         if (callOfWildEntity instanceof Ocelot) { | ||||||
|  |             // Ocelot.Type is deprecated, but that's fine since this only runs on 1.13 | ||||||
|             int numberOfTypes = Ocelot.Type.values().length; |             int numberOfTypes = Ocelot.Type.values().length; | ||||||
|             ((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]); |             ((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]); | ||||||
|             ((Ocelot) callOfWildEntity).setAdult(); |  | ||||||
|         } else if (callOfWildEntity instanceof Cat) { |  | ||||||
|             int numberOfTypes = Cat.Type.values().length; |  | ||||||
|             ((Cat) callOfWildEntity).setCatType(Cat.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]); |  | ||||||
|             ((Cat) callOfWildEntity).setAdult(); |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         ((Ageable) callOfWildEntity).setAdult(); | ||||||
|  |  | ||||||
|         callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(entityType))); |         callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(entityType))); | ||||||
|  |  | ||||||
|         //Particle effect |         //Particle effect | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jsinco
					Jsinco