Skip to content

Commit

Permalink
Show bee count and honey level for bee hives/nests in /iteminfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Feb 9, 2020
1 parent 630b053 commit 23ee058
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -16,6 +16,7 @@
import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.block.Beehive;
import org.bukkit.block.BlockState;
import org.bukkit.block.Container;
import org.bukkit.command.CommandSender;
Expand Down Expand Up @@ -169,6 +170,13 @@ public static void addInfo(ItemInfoEvent event) {
sender.sendMessage(" " + ChatColor.GRAY + "Content: " + stacks + " Stacks");
}
}
if (blockState instanceof Beehive) {
Beehive beehive = (Beehive) blockState;
int honeyLevel = ((org.bukkit.block.data.type.Beehive) beehive.getBlockData()).getHoneyLevel();
sender.sendMessage(" " + ChatColor.GRAY + "Honey Level: " + honeyLevel);
int bees = beehive.getEntityCount();
sender.sendMessage(" " + ChatColor.GRAY + "Bees: " + bees);
}
}
}
}
Expand Down

0 comments on commit 23ee058

Please sign in to comment.