瀏覽代碼

Drowned Transformation will no longer enabled XP on mob spawners, Kelp will now count the whole block for XP

nossr50 6 年之前
父節點
當前提交
bb46b2a6ac

+ 4 - 0
Changelog.txt

@@ -7,6 +7,10 @@ Key:
   ! Change
   ! Change
   - Removal
   - Removal
 
 
+Version 2.1.16
+    Breaking Kelp should now count the whole plant for XP
+    Spawned Mobs that are not supposed to award XP will no longer reward XP once transformed (ie: drowned)
+
 Version 2.1.15
 Version 2.1.15
     Fixed a bug where a max rank of Fuel Efficiency would cause its benefits to be lost
     Fixed a bug where a max rank of Fuel Efficiency would cause its benefits to be lost
 
 

+ 1 - 1
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.1.15</version>
+    <version>2.1.16</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>

+ 13 - 0
src/main/java/com/gmail/nossr50/listeners/EntityListener.java

@@ -54,6 +54,19 @@ public class EntityListener implements Listener {
         this.plugin = plugin;
         this.plugin = plugin;
     }
     }
 
 
+    @EventHandler(priority = EventPriority.MONITOR)
+    public void onEntityTransform(EntityTransformEvent event)
+    {
+        //Transfer metadata keys from mob-spawned mobs to new mobs
+        if(event.getEntity().getMetadata(mcMMO.entityMetadataKey) == null || event.getEntity().getMetadata(mcMMO.entityMetadataKey).size() <= 0)
+        {
+            for(Entity entity : event.getTransformedEntities())
+            {
+                entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
+            }
+        }
+    }
+
     @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
     @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
     public void onEntityTargetEntity(EntityTargetLivingEntityEvent event)
     public void onEntityTargetEntity(EntityTargetLivingEntityEvent event)
     {
     {

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java

@@ -126,7 +126,7 @@ public class HerbalismManager extends SkillManager {
     public void herbalismBlockCheck(BlockState blockState) {
     public void herbalismBlockCheck(BlockState blockState) {
         Player player = getPlayer();
         Player player = getPlayer();
         Material material = blockState.getType();
         Material material = blockState.getType();
-        boolean oneBlockPlant = !(material == Material.CACTUS || material == Material.CHORUS_PLANT || material == Material.SUGAR_CANE);
+        boolean oneBlockPlant = !(material == Material.CACTUS || material == Material.CHORUS_PLANT || material == Material.SUGAR_CANE || material == Material.KELP_PLANT);
 
 
         // Prevents placing and immediately breaking blocks for exp
         // Prevents placing and immediately breaking blocks for exp
         if (oneBlockPlant && mcMMO.getPlaceStore().isTrue(blockState)) {
         if (oneBlockPlant && mcMMO.getPlaceStore().isTrue(blockState)) {