diff --git a/src/main/java/com/gmail/nossr50/Item.java b/src/main/java/com/gmail/nossr50/Item.java index 7eea2b6ab..8e002d5ec 100644 --- a/src/main/java/com/gmail/nossr50/Item.java +++ b/src/main/java/com/gmail/nossr50/Item.java @@ -33,9 +33,7 @@ public class Item { { ItemStack inhand = player.getItemInHand(); if(LoadProperties.chimaeraWingEnable && inhand.getTypeId() == LoadProperties.chimaeraId) - { chimaerawing(player, plugin); - } } public static void chimaerawing(Player player, Plugin plugin) @@ -67,7 +65,7 @@ public class Item { } } - if(player.getBedSpawnLocation() != null) + if(player.getBedSpawnLocation() != null && player.getBedSpawnLocation().getBlock().getType().equals(Material.BED_BLOCK)) player.teleport(player.getBedSpawnLocation()); else player.teleport(player.getWorld().getSpawnLocation()); diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index aa819214f..0d02e6baf 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -77,19 +77,6 @@ public class LoadProperties { axesxpmodifier, acrobaticsxpmodifier, animalXP, creeperXP, skeletonXP, spiderXP, ghastXP, slimeXP, zombieXP, pigzombieXP, endermanXP, cavespiderXP, silverfishXP, blazeXP, magmacubeXP, enderdragonXP; -// public static List excavationFromDirt = new ArrayList(); -// public static List excavationFromGrass = new ArrayList(); -// public static List excavationFromSand = new ArrayList(); -// public static List excavationFromGravel = new ArrayList(); -// public static List excavationFromClay = new ArrayList(); -// public static List excavationFromMycel = new ArrayList(); -// public static List excavationFromSoulSand = new ArrayList(); -// public static List fishingRewardsTier1 = new ArrayList(); -// public static List fishingRewardsTier2 = new ArrayList(); -// public static List fishingRewardsTier3 = new ArrayList(); -// public static List fishingRewardsTier4 = new ArrayList(); -// public static List fishingRewardsTier5 = new ArrayList(); - public static HUDType defaulthud; protected static File configFile; protected static File dataFolder; @@ -153,9 +140,8 @@ public class LoadProperties { // Setup default HUD String temp = readString("Spout.HUD.Default", "STANDARD"); for (HUDType x : HUDType.values()) { - if (x.toString().equalsIgnoreCase(temp)) { + if (x.toString().equalsIgnoreCase(temp)) defaulthud = x; - } } enableAbilityMessages = readBoolean("Abilities.Messages", true); @@ -418,141 +404,5 @@ public class LoadProperties { blazeXP = readDouble("Experience.Combat.Multiplier.Blaze", 3.0); magmacubeXP = readDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0); enderdragonXP = readDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0); - -// // Load treasures -// Map treasures = new HashMap(); -// -// ConfigurationSection treasureSection = config.getConfigurationSection("Treasures"); -// Set treasureConfigSet = treasureSection.getKeys(false); -// Iterator iterator = treasureConfigSet.iterator(); -// while(iterator.hasNext()) -// { -// String treasureName = iterator.next(); -// -// // Validate all the things! -// List reason = new ArrayList(); -// -// if(!config.contains("Treasures." + treasureName + ".ID")) reason.add("Missing ID"); -// if(!config.contains("Treasures." + treasureName + ".Amount")) reason.add("Missing Amount"); -// if(!config.contains("Treasures." + treasureName + ".Data")) reason.add("Missing Data"); -// -// int id = config.getInt("Treasures." + treasureName + ".ID"); -// int amount = config.getInt("Treasures." + treasureName + ".Amount"); -// int data = config.getInt("Treasures." + treasureName + ".Data"); -// -// if(Material.getMaterial(id) == null) reason.add("Invlid id: " + id); -// if(amount < 1) reason.add("Invalid amount: " + amount); -// if(data > 127 || data < -128) reason.add("Invalid data: " + data); -// -// if(!config.contains("Treasures." + treasureName + ".XP")) reason.add("Missing XP"); -// if(!config.contains("Treasures." + treasureName + ".Drop_Chance")) reason.add("Missing Drop_Chance"); -// if(!config.contains("Treasures." + treasureName + ".Drop_Level")) reason.add("Missing Drop_Level"); -// -// int xp = config.getInt("Treasures." + treasureName + ".XP"); -// Double dropChance = config.getDouble("Treasures." + treasureName + ".Drop_Chance"); -// int dropLevel = config.getInt("Treasures." + treasureName + ".Drop_Level"); -// -// if(xp < 0) reason.add("Invalid xp: " + xp); -// if(dropChance < 0) reason.add("Invalid Drop_Chance: " + dropChance); -// if(dropLevel < 0) reason.add("Invalid Drop_Level: " + dropLevel); -// -// ItemStack item = new ItemStack(id, amount, (byte) 0, (byte) data); -// -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) { -// if(config.getConfigurationSection("Treasures." + treasureName + ".Drops_From").getKeys(false).size() != 1) -// reason.add("Fishing drops cannot also be excavation drops"); -// -// if(!config.contains("Treasures." + treasureName + ".Max_Level")) reason.add("Missing Max_Level"); -// int maxLevel = config.getInt("Treasures." + treasureName + ".Max_Level"); -// -// if(maxLevel < 0) reason.add("Invalid Max_Level: " + maxLevel); -// -// if(noErrorsInTreasure(reason)) { -// FishingTreasure fTreasure = new FishingTreasure(item, xp, dropChance, dropLevel, maxLevel); -// treasures.put(treasureName, fTreasure); -// } -// } else { -// ExcavationTreasure eTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Dirt", false)) -// eTreasure.setDropsFromDirt(); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Grass", false)) -// eTreasure.setDropsFromGrass(); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Sand", false)) -// eTreasure.setDropsFromSand(); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Gravel", false)) -// eTreasure.setDropsFromGravel(); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Clay", false)) -// eTreasure.setDropsFromClay(); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Mycelium", false)) -// eTreasure.setDropsFromMycel(); -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Soul_Sand", false)) -// eTreasure.setDropsFromSoulSand(); -// -// if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) { -// reason.add("Excavation drops cannot also be fishing drops"); -// } -// -// if(noErrorsInTreasure(reason)) { -// treasures.put(treasureName, eTreasure); -// } -// } - } -// -// List excavationTreasures = config.getStringList("Excavation.Treasure"); -// List fishingTreasures = config.getStringList("Fishing.Treasure"); -// -// Iterator treasureIterator = treasures.keySet().iterator(); -// while(treasureIterator.hasNext()) { -// String treasureKey = treasureIterator.next(); -// Treasure treasure = treasures.get(treasureKey); -// -// if(treasure instanceof FishingTreasure) { -// if(!fishingTreasures.contains(treasureKey)) continue; -// -// FishingTreasure fTreasure = (FishingTreasure) treasure; -// int dropLevel = fTreasure.getDropLevel(); -// int maxLevel = fTreasure.getMaxLevel(); -// -// if(dropLevel <= fishingTier1 && maxLevel >= fishingTier1) -// fishingRewardsTier1.add(fTreasure); -// if(dropLevel <= fishingTier2 && maxLevel >= fishingTier2) -// fishingRewardsTier2.add(fTreasure); -// if(dropLevel <= fishingTier3 && maxLevel >= fishingTier3) -// fishingRewardsTier3.add(fTreasure); -// if(dropLevel <= fishingTier4 && maxLevel >= fishingTier4) -// fishingRewardsTier4.add(fTreasure); -// if(dropLevel <= fishingTier5 && maxLevel >= fishingTier5) -// fishingRewardsTier5.add(fTreasure); -// -// } else if(treasure instanceof ExcavationTreasure) { -// if(!excavationTreasures.contains(treasureKey)) continue; -// -// ExcavationTreasure eTreasure = (ExcavationTreasure) treasure; -// if(eTreasure.getDropsFromDirt()) -// excavationFromDirt.add(eTreasure); -// if(eTreasure.getDropsFromGrass()) -// excavationFromGrass.add(eTreasure); -// if(eTreasure.getDropsFromSand()) -// excavationFromSand.add(eTreasure); -// if(eTreasure.getDropsFromGravel()) -// excavationFromGravel.add(eTreasure); -// if(eTreasure.getDropsFromClay()) -// excavationFromClay.add(eTreasure); -// if(eTreasure.getDropsFromMycel()) -// excavationFromMycel.add(eTreasure); -// if(eTreasure.getDropsFromSoulSand()) -// excavationFromSoulSand.add(eTreasure); -// } -// } -// } -// -// private boolean noErrorsInTreasure(List issues) { -// if(issues.isEmpty()) return true; -// -// for(String issue : issues) { -// plugin.getLogger().warning(issue); -// } -// -// return false; -// } + } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/LoadTreasures.java b/src/main/java/com/gmail/nossr50/config/LoadTreasures.java index 6053aafc2..960cf318b 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadTreasures.java +++ b/src/main/java/com/gmail/nossr50/config/LoadTreasures.java @@ -50,7 +50,7 @@ public class LoadTreasures { // If not exist, copy from the jar if (!configFile.exists()) { dataFolder.mkdir(); - config.options().copyDefaults(); + plugin.saveTreasuresConfig(); } addDefaults(); loadKeys(); diff --git a/src/main/resources/treasures.yml b/src/main/resources/treasures.yml index 05cc364d9..713487671 100644 --- a/src/main/resources/treasures.yml +++ b/src/main/resources/treasures.yml @@ -2,13 +2,6 @@ # Settings for Fishing ### Fishing: - Drops_Enabled: true - Tier_Levels: - Tier1: 0 - Tier2: 200 - Tier3: 400 - Tier4: 600 - Tier5: 800 Treasure: - Leather_Boots - Leather_Helmet