Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.bowlerguy66.bukkitsandbox;
- import java.util.HashMap;
- import org.bukkit.Bukkit;
- import org.bukkit.inventory.ItemStack;
- import net.md_5.bungee.api.ChatColor;
- public class DropTable {
- private String name;
- private HashMap<ItemStack, Double> table;
- public DropTable() {
- this.name = "Default name";
- this.table = new HashMap<ItemStack, Double>();
- }
- public HashMap<ItemStack, Double> getFinalTable() {
- if(!isUsable()) {
- return null;
- }
- int multiplier = 1;
- for(ItemStack i : table.keySet()) {
- double d = table.get(i);
- if(d < 0.1) {
- multiplier = 10;
- }
- if(d < 0.01) {
- multiplier = 100;
- }
- if(d < 0.001) {
- multiplier = 1000;
- }
- }
- for() {
- }
- }
- public boolean isUsable() {
- double total = 0;
- if(table.isEmpty()) {
- return false;
- }
- for(ItemStack i : table.keySet()) {
- double d = table.get(i);
- total += d;
- }
- if(total == 100) {
- return true;
- } else if(total > 100) {
- Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "The table \"" + name + "\" has a total that is over 100. (" + total + ")");
- return false;
- } else if(total < 100) {
- Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "The table \"" + name + "\" has a total that is below 100. (" + total + ")");
- return false;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement