浏览代码

Add Glow Berries to Farmer's Diet

nossr50 4 年之前
父节点
当前提交
551fac84a5
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 1 0
      Changelog.txt
  2. 10 0
      src/main/java/com/gmail/nossr50/listeners/EntityListener.java

+ 1 - 0
Changelog.txt

@@ -7,6 +7,7 @@ Version 2.1.197
     Added Goat 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 Berries to Farmer's Diet
     Updated Super Breaker to recognize the new pick-axe appropriate blocks
     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
          * 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) {
             case BAKED_POTATO: /*
                                 * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @