2
0
Эх сурвалжийг харах

Add Glow Berries to Farmer's Diet

nossr50 4 жил өмнө
parent
commit
551fac84a5

+ 1 - 0
Changelog.txt

@@ -7,6 +7,7 @@ Version 2.1.197
     Added Goat to experience.yml for combat and taming
     Added Goat to experience.yml for combat and taming
     Added Axolotl to experience.yml for combat and taming
     Added Axolotl to experience.yml for combat and taming
     Added Glow_Squid to experience.yml for combat and taming
     Added Glow_Squid to experience.yml for combat and taming
+    Added Glow Berries to Farmer's Diet
     Updated Super Breaker to recognize the new pick-axe appropriate blocks
     Updated Super Breaker to recognize the new pick-axe appropriate blocks
     Updated Tree Feller to recognize Azalea Leaves
     Updated Tree Feller to recognize Azalea Leaves
 
 

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

@@ -912,6 +912,16 @@ public class EntityListener implements Listener {
          * is based on how 'common' the item is We can adjust this quite easily
          * is based on how 'common' the item is We can adjust this quite easily
          * if we find something is giving too much of a bonus
          * if we find something is giving too much of a bonus
          */
          */
+
+        //Hacky 1.17 support
+        if(foodInHand.getKey().getKey().equalsIgnoreCase("glow_berries")) {
+            if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) {
+                event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel));
+            }
+
+            return;
+        }
+
         switch (foodInHand) {
         switch (foodInHand) {
             case BAKED_POTATO: /*
             case BAKED_POTATO: /*
                                 * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @
                                 * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @