mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Change how we do custom drops
Beginnings of fishing drops
This commit is contained in:
parent
1943ce884a
commit
ad2ed37d0a
@ -20,28 +20,33 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.datatypes.HUDType;
|
import com.gmail.nossr50.datatypes.HUDType;
|
||||||
|
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
||||||
|
import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
|
||||||
|
import com.gmail.nossr50.datatypes.treasure.Treasure;
|
||||||
|
|
||||||
public class LoadProperties {
|
public class LoadProperties {
|
||||||
public static Boolean enableOnlyActivateWhenSneaking,
|
public static Boolean enableOnlyActivateWhenSneaking,
|
||||||
enableAbilityMessages, enableAbilities, showDisplayName, showFaces,
|
enableAbilityMessages, enableAbilities, showDisplayName, showFaces,
|
||||||
watch, xplockEnable, xpbar, xpicon, partybar, string, bucket, web,
|
xplockEnable, xpbar, xpicon, partybar, xprateEnable, spoutEnabled,
|
||||||
xprateEnable, slimeballs, spoutEnabled, donateMessage,
|
donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable,
|
||||||
chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable,
|
mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable,
|
||||||
mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable,
|
whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable,
|
||||||
statsEnable, addxpEnable, ptpEnable, mmoeditEnable,
|
|
||||||
clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable,
|
clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable,
|
||||||
mcrefreshEnable, aEnable, pEnable, enableMotd, enableMySpawn,
|
mcrefreshEnable, aEnable, pEnable, enableMotd, enableMySpawn,
|
||||||
enableCobbleToMossy, useMySQL, cocoabeans, mushrooms,
|
enableCobbleToMossy, useMySQL, toolsLoseDurabilityFromAbilities,
|
||||||
toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe,
|
pvpxp, miningrequirespickaxe, excavationRequiresShovel,
|
||||||
excavationRequiresShovel, woodcuttingrequiresaxe, eggs, apples,
|
woodcuttingrequiresaxe, anvilmessages, mayDowngradeEnchants,
|
||||||
cake, music, diamond, glowstone, slowsand, sulphur, netherrack,
|
|
||||||
bones, coal, clay, anvilmessages, mayDowngradeEnchants,
|
|
||||||
mayLoseEnchants, fishingDrops, leatherArmor, ironArmor, goldArmor,
|
mayLoseEnchants, fishingDrops, leatherArmor, ironArmor, goldArmor,
|
||||||
diamondArmor, woodenTools, stoneTools, ironTools, goldTools,
|
diamondArmor, woodenTools, stoneTools, ironTools, goldTools,
|
||||||
diamondTools, enderPearl, blazeRod, records, glowstoneDust,
|
diamondTools, enderPearl, blazeRod, records, glowstoneDust,
|
||||||
@ -90,20 +95,13 @@ public class LoadProperties {
|
|||||||
excavationxpmodifier, archeryxpmodifier, swordsxpmodifier,
|
excavationxpmodifier, archeryxpmodifier, swordsxpmodifier,
|
||||||
axesxpmodifier, acrobaticsxpmodifier;
|
axesxpmodifier, acrobaticsxpmodifier;
|
||||||
|
|
||||||
public static List<String> excavationTreasures = new ArrayList<String>();
|
public static List<ExcavationTreasure> excavationFromDirt = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Integer> excavationIDs = new ArrayList<Integer>();
|
public static List<ExcavationTreasure> excavationFromGrass = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Integer> excavationDatas = new ArrayList<Integer>();
|
public static List<ExcavationTreasure> excavationFromSand = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Integer> excavationAmounts = new ArrayList<Integer>();
|
public static List<ExcavationTreasure> excavationFromGravel = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Integer> excavationXPs = new ArrayList<Integer>();
|
public static List<ExcavationTreasure> excavationFromClay = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Double> excavationDropChances = new ArrayList<Double>();
|
public static List<ExcavationTreasure> excavationFromMycel = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Integer> excavationDropLevels = new ArrayList<Integer>();
|
public static List<ExcavationTreasure> excavationFromSoulSand = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<Boolean> excavationFromDirt = new ArrayList<Boolean>();
|
|
||||||
public static List<Boolean> excavationFromGrass = new ArrayList<Boolean>();
|
|
||||||
public static List<Boolean> excavationFromSand = new ArrayList<Boolean>();
|
|
||||||
public static List<Boolean> excavationFromGravel = new ArrayList<Boolean>();
|
|
||||||
public static List<Boolean> excavationFromClay = new ArrayList<Boolean>();
|
|
||||||
public static List<Boolean> excavationFromMycel = new ArrayList<Boolean>();
|
|
||||||
public static List<Boolean> excavationFromSoulSand = new ArrayList<Boolean>();
|
|
||||||
|
|
||||||
public static HUDType defaulthud;
|
public static HUDType defaulthud;
|
||||||
protected static File configFile;
|
protected static File configFile;
|
||||||
@ -394,24 +392,6 @@ public class LoadProperties {
|
|||||||
keepEnchantsRank3 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_3", 30);
|
keepEnchantsRank3 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_3", 30);
|
||||||
keepEnchantsRank4 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_4", 40);
|
keepEnchantsRank4 = readInteger("Arcane_Forging.Keep_Enchants.Chance.Rank_4", 40);
|
||||||
|
|
||||||
cocoabeans = readBoolean("Excavation.Drops.Cocoa_Beans", true);
|
|
||||||
mushrooms = readBoolean("Excavation.Drops.Mushrooms", true);
|
|
||||||
glowstone = readBoolean("Excavation.Drops.Glowstone", true);
|
|
||||||
eggs = readBoolean("Excavation.Drops.Eggs", true);
|
|
||||||
apples = readBoolean("Excavation.Drops.Apples", true);
|
|
||||||
cake = readBoolean("Excavation.Drops.Cake", true);
|
|
||||||
music = readBoolean("Excavation.Drops.Music", true);
|
|
||||||
diamond = readBoolean("Excavation.Drops.Diamond", true);
|
|
||||||
slowsand = readBoolean("Excavation.Drops.Slowsand", true);
|
|
||||||
sulphur = readBoolean("Excavation.Drops.Sulphur", true);
|
|
||||||
netherrack = readBoolean("Excavation.Drops.Netherrack", true);
|
|
||||||
bones = readBoolean("Excavation.Drops.Bones", true);
|
|
||||||
slimeballs = readBoolean("Excavation.Drops.Slimeballs", true);
|
|
||||||
watch = readBoolean("Excavation.Drops.Watch", true);
|
|
||||||
string = readBoolean("Excavation.Drops.String", true);
|
|
||||||
bucket = readBoolean("Excavation.Drops.Bucket", true);
|
|
||||||
web = readBoolean("Excavation.Drops.Web", true);
|
|
||||||
|
|
||||||
fishingDrops = readBoolean("Fishing.Drops.Item_Drops_Enabled", true);
|
fishingDrops = readBoolean("Fishing.Drops.Item_Drops_Enabled", true);
|
||||||
fishingDropChanceTier1 = readInteger("Fishing.Drops.Drop_Chance.Tier_1", 20);
|
fishingDropChanceTier1 = readInteger("Fishing.Drops.Drop_Chance.Tier_1", 20);
|
||||||
fishingDropChanceTier2 = readInteger("Fishing.Drops.Drop_Chance.Tier_2", 25);
|
fishingDropChanceTier2 = readInteger("Fishing.Drops.Drop_Chance.Tier_2", 25);
|
||||||
@ -457,25 +437,77 @@ public class LoadProperties {
|
|||||||
aDisplayNames = readBoolean("Commands.a.Display_Names", true);
|
aDisplayNames = readBoolean("Commands.a.Display_Names", true);
|
||||||
pDisplayNames = readBoolean("Commands.p.Display_Names", true);
|
pDisplayNames = readBoolean("Commands.p.Display_Names", true);
|
||||||
|
|
||||||
//Custom Excavation Drops
|
// Load treasures
|
||||||
excavationTreasures = config.getStringList("Excavation.Treasure");
|
Map<String, Treasure> treasures = new HashMap<String, Treasure>();
|
||||||
Iterator<String> iterator = excavationTreasures.iterator();
|
|
||||||
|
ConfigurationSection treasureSection = config.getConfigurationSection("Treasures");
|
||||||
|
Set<String> treasureConfigSet = treasureSection.getKeys(false);
|
||||||
|
Iterator<String> iterator = treasureConfigSet.iterator();
|
||||||
while(iterator.hasNext())
|
while(iterator.hasNext())
|
||||||
{
|
{
|
||||||
String temp2 = iterator.next();
|
String treasureName = iterator.next();
|
||||||
excavationIDs.add(config.getInt("Treasures." + temp2 + ".ID"));
|
|
||||||
excavationDatas.add(config.getInt("Treasures." + temp2 + ".Data"));
|
int id = config.getInt("Treasures." + treasureName + ".ID");
|
||||||
excavationXPs.add(config.getInt("Treasures." + temp2 + ".XP"));
|
int amount = config.getInt("Treasures." + treasureName + ".Amount");
|
||||||
excavationAmounts.add(config.getInt("Treasures." + temp2 + ".Amount"));
|
int data = config.getInt("Treasures." + treasureName + ".Data");
|
||||||
excavationDropChances.add(config.getDouble("Treasures." + temp2 + ".Drop_Chance"));
|
|
||||||
excavationDropLevels.add(config.getInt("Treasures." + temp2 + ".Drop_Level"));
|
int xp = config.getInt("Treasures." + treasureName + ".XP");
|
||||||
excavationFromDirt.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Dirt"));
|
Double dropChance = config.getDouble("Treasures." + treasureName + ".Drop_Chance");
|
||||||
excavationFromGrass.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Grass"));
|
int dropLevel = config.getInt("Treasures." + treasureName + ".Drop_Level");
|
||||||
excavationFromSand.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Sand"));
|
|
||||||
excavationFromGravel.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Gravel"));
|
ItemStack item = new ItemStack(id, amount, (byte) 0, (byte) data);
|
||||||
excavationFromClay.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Clay"));
|
|
||||||
excavationFromMycel.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Mycelium"));
|
if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) {
|
||||||
excavationFromSoulSand.add(config.getBoolean("Treasures." + temp2 + ".Drops_From.Soul_Sand"));
|
// TODO: Fishing
|
||||||
|
} 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();
|
||||||
|
|
||||||
|
treasures.put(treasureName, eTreasure);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> excavationTreasures = config.getStringList("Excavation.Treasure");
|
||||||
|
|
||||||
|
Iterator<String> treasureIterator = treasures.keySet().iterator();
|
||||||
|
while(treasureIterator.hasNext()) {
|
||||||
|
String treasureKey = treasureIterator.next();
|
||||||
|
Treasure treasure = treasures.get(treasureKey);
|
||||||
|
|
||||||
|
if(treasure instanceof FishingTreasure) {
|
||||||
|
// TODO: Fishing
|
||||||
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
package com.gmail.nossr50.datatypes.treasure;
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class ExcavationTreasure extends Treasure {
|
||||||
|
// dirt grass sand gravel clay mycel soulsand
|
||||||
|
// 00000001 - dirt 1
|
||||||
|
// 00000010 - grass 2
|
||||||
|
// 00000100 - sand 4
|
||||||
|
// 00001000 - gravel 8
|
||||||
|
// 00010000 - clay 16
|
||||||
|
// 00100000 - mycel 32
|
||||||
|
// 01000000 - soulsand 64
|
||||||
|
private byte dropsFrom = 0x0;
|
||||||
|
|
||||||
|
public ExcavationTreasure(ItemStack drop, int xp, Double dropChance, int dropLevel) {
|
||||||
|
super(drop, xp, dropChance, dropLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Raw getters and setters
|
||||||
|
public byte getDropsFrom() {
|
||||||
|
return dropsFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFrom(byte dropsFrom) {
|
||||||
|
this.dropsFrom = dropsFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
public boolean getDropsFromDirt() {
|
||||||
|
return getDropFromMask(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getDropsFromGrass() {
|
||||||
|
return getDropFromMask(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getDropsFromSand() {
|
||||||
|
return getDropFromMask(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getDropsFromGravel() {
|
||||||
|
return getDropFromMask(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getDropsFromClay() {
|
||||||
|
return getDropFromMask(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getDropsFromMycel() {
|
||||||
|
return getDropFromMask(32);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getDropsFromSoulSand() {
|
||||||
|
return getDropFromMask(64);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean getDropFromMask(int mask) {
|
||||||
|
return ((dropsFrom & mask) > 0) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
public void setDropsFromDirt() {
|
||||||
|
setDropFromMask(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFromGrass() {
|
||||||
|
setDropFromMask(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFromSand() {
|
||||||
|
setDropFromMask(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFromGravel() {
|
||||||
|
setDropFromMask(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFromClay() {
|
||||||
|
setDropFromMask(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFromMycel() {
|
||||||
|
setDropFromMask(32);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropsFromSoulSand() {
|
||||||
|
setDropFromMask(64);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setDropFromMask(int mask) {
|
||||||
|
dropsFrom |= mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Un-setters
|
||||||
|
public void unsetDropsFromDirt() {
|
||||||
|
unsetDropFromMask(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unsetDropsFromGrass() {
|
||||||
|
unsetDropFromMask(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unsetDropsFromSand() {
|
||||||
|
unsetDropFromMask(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unsetDropsFromGravel() {
|
||||||
|
unsetDropFromMask(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unsetDropsFromClay() {
|
||||||
|
unsetDropFromMask(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unsetDropsFromMycel() {
|
||||||
|
unsetDropFromMask(32);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unsetDropsFromSoulSand() {
|
||||||
|
unsetDropFromMask(64);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unsetDropFromMask(int mask) {
|
||||||
|
dropsFrom &= ~mask;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.gmail.nossr50.datatypes.treasure;
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class FishingTreasure extends Treasure {
|
||||||
|
|
||||||
|
public FishingTreasure(ItemStack drop, int xp, Double dropChance, int dropLevel) {
|
||||||
|
super(drop, xp, dropChance, dropLevel);
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.gmail.nossr50.datatypes.treasure;
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public abstract class Treasure {
|
||||||
|
private int xp;
|
||||||
|
private Double dropChance;
|
||||||
|
private int dropLevel;
|
||||||
|
|
||||||
|
private ItemStack drop;
|
||||||
|
|
||||||
|
public Treasure(ItemStack drop, int xp, Double dropChance, int dropLevel) {
|
||||||
|
this.drop = drop;
|
||||||
|
this.xp = xp;
|
||||||
|
this.dropChance = dropChance;
|
||||||
|
this.dropLevel = dropLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getDrop() {
|
||||||
|
return drop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDrop(ItemStack drop) {
|
||||||
|
this.drop = drop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getXp() {
|
||||||
|
return xp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXp(int xp) {
|
||||||
|
this.xp = xp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getDropChance() {
|
||||||
|
return dropChance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropChance(Double dropChance) {
|
||||||
|
this.dropChance = dropChance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDropLevel() {
|
||||||
|
return dropLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropLevel(int dropLevel) {
|
||||||
|
this.dropLevel = dropLevel;
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,6 @@
|
|||||||
package com.gmail.nossr50.skills;
|
package com.gmail.nossr50.skills;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -36,6 +35,8 @@ import com.gmail.nossr50.config.LoadProperties;
|
|||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
|
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
||||||
|
|
||||||
import org.getspout.spoutapi.sound.SoundEffect;
|
import org.getspout.spoutapi.sound.SoundEffect;
|
||||||
|
|
||||||
public class Excavation
|
public class Excavation
|
||||||
@ -91,131 +92,95 @@ public class Excavation
|
|||||||
ArrayList<ItemStack> is = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> is = new ArrayList<ItemStack>();
|
||||||
int xp = 0;
|
int xp = 0;
|
||||||
|
|
||||||
//Custom Excavation Drops
|
|
||||||
List<Integer> idValues = LoadProperties.excavationIDs;
|
|
||||||
List<Integer> dataValues = LoadProperties.excavationDatas;
|
|
||||||
List<Integer> xpValues = LoadProperties.excavationXPs;
|
|
||||||
List<Integer> amounts = LoadProperties.excavationAmounts;
|
|
||||||
List<Double> dropChances = LoadProperties.excavationDropChances;
|
|
||||||
List<Integer> dropLevels = LoadProperties.excavationDropLevels;
|
|
||||||
List<Boolean> dirt = LoadProperties.excavationFromDirt;
|
|
||||||
List<Boolean> grass = LoadProperties.excavationFromGrass;
|
|
||||||
List<Boolean> sand = LoadProperties.excavationFromSand;
|
|
||||||
List<Boolean> gravel = LoadProperties.excavationFromGravel;
|
|
||||||
List<Boolean> clay = LoadProperties.excavationFromClay;
|
|
||||||
List<Boolean> mycel = LoadProperties.excavationFromMycel;
|
|
||||||
List<Boolean> soulSand = LoadProperties.excavationFromSoulSand;
|
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case DIRT:
|
case DIRT:
|
||||||
for(int i = 0; i < dirt.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromDirt)
|
||||||
{
|
{
|
||||||
if(dirt.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GRASS:
|
case GRASS:
|
||||||
for(int i = 0; i < grass.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromGrass)
|
||||||
{
|
{
|
||||||
if(grass.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SAND:
|
case SAND:
|
||||||
for(int i = 0; i < sand.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromSand)
|
||||||
{
|
{
|
||||||
if(sand.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GRAVEL:
|
case GRAVEL:
|
||||||
for(int i = 0; i < gravel.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromGravel)
|
||||||
{
|
{
|
||||||
if(gravel.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CLAY:
|
case CLAY:
|
||||||
for(int i = 0; i < clay.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromClay)
|
||||||
{
|
{
|
||||||
if(clay.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MYCEL:
|
case MYCEL:
|
||||||
for(int i = 0; i < mycel.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromMycel)
|
||||||
{
|
{
|
||||||
if(mycel.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOUL_SAND:
|
case SOUL_SAND:
|
||||||
for(int i = 0; i < soulSand.size(); i++)
|
for(ExcavationTreasure treasure : LoadProperties.excavationFromSoulSand)
|
||||||
{
|
{
|
||||||
if(soulSand.get(i))
|
if(skillLevel >= treasure.getDropLevel())
|
||||||
{
|
{
|
||||||
if(skillLevel >= dropLevels.get(i))
|
if(Math.random() * 100 > (100.00 - treasure.getDropChance()))
|
||||||
{
|
{
|
||||||
if(Math.random() * 100 > (100.00 - dropChances.get(i)))
|
xp += treasure.getXp();
|
||||||
{
|
is.add(treasure.getDrop());
|
||||||
xp += xpValues.get(i);
|
|
||||||
is.add(new ItemStack(idValues.get(i), amounts.get(i), (byte)0, dataValues.get(i).byteValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,24 +259,6 @@ Fishing:
|
|||||||
# Settings for Excavation
|
# Settings for Excavation
|
||||||
###
|
###
|
||||||
Excavation:
|
Excavation:
|
||||||
Drops:
|
|
||||||
Cake: true
|
|
||||||
Sulphur: true
|
|
||||||
Bones: true
|
|
||||||
Apples: true
|
|
||||||
Slimeballs: true
|
|
||||||
Bucket: true
|
|
||||||
Netherrack: true
|
|
||||||
Mushrooms: true
|
|
||||||
Eggs: true
|
|
||||||
Slowsand: true
|
|
||||||
Watch: true
|
|
||||||
Web: true
|
|
||||||
String: true
|
|
||||||
Glowstone: true
|
|
||||||
Music: true
|
|
||||||
Diamond: true
|
|
||||||
Cocoa_Beans: true
|
|
||||||
Treasure:
|
Treasure:
|
||||||
- Cake
|
- Cake
|
||||||
- Gunpowder
|
- Gunpowder
|
||||||
@ -298,6 +280,9 @@ Excavation:
|
|||||||
- Diamond
|
- Diamond
|
||||||
- Cocoa_Beans
|
- Cocoa_Beans
|
||||||
|
|
||||||
|
#
|
||||||
|
# Configuration to define Treasures
|
||||||
|
###
|
||||||
Treasures:
|
Treasures:
|
||||||
Cake:
|
Cake:
|
||||||
ID: 354
|
ID: 354
|
||||||
@ -322,13 +307,7 @@ Treasures:
|
|||||||
Drop_Chance: 10.0
|
Drop_Chance: 10.0
|
||||||
Drop_Level: 75
|
Drop_Level: 75
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: true
|
Gravel: true
|
||||||
Clay: false
|
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Bone:
|
Bone:
|
||||||
ID: 352
|
ID: 352
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -337,13 +316,7 @@ Treasures:
|
|||||||
Drop_Chance: 10.0
|
Drop_Chance: 10.0
|
||||||
Drop_Level: 175
|
Drop_Level: 175
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: true
|
Gravel: true
|
||||||
Clay: false
|
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Apple:
|
Apple:
|
||||||
ID: 260
|
ID: 260
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -352,13 +325,8 @@ Treasures:
|
|||||||
Drop_Chance: 0.1
|
Drop_Chance: 0.1
|
||||||
Drop_Level: 250
|
Drop_Level: 250
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: true
|
Grass: true
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: false
|
|
||||||
Mycelium: true
|
Mycelium: true
|
||||||
Soul_Sand: false
|
|
||||||
Slimeball:
|
Slimeball:
|
||||||
ID: 341
|
ID: 341
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -367,13 +335,7 @@ Treasures:
|
|||||||
Drop_Chance: 5.0
|
Drop_Chance: 5.0
|
||||||
Drop_Level: 150
|
Drop_Level: 150
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: true
|
Clay: true
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Bucket:
|
Bucket:
|
||||||
ID: 325
|
ID: 325
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -382,13 +344,7 @@ Treasures:
|
|||||||
Drop_Chance: 0.1
|
Drop_Chance: 0.1
|
||||||
Drop_Level: 500
|
Drop_Level: 500
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: true
|
Clay: true
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Netherrack:
|
Netherrack:
|
||||||
ID: 87
|
ID: 87
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -397,13 +353,7 @@ Treasures:
|
|||||||
Drop_Chance: 0.5
|
Drop_Chance: 0.5
|
||||||
Drop_Level: 850
|
Drop_Level: 850
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: true
|
Gravel: true
|
||||||
Clay: false
|
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Red_Mushroom:
|
Red_Mushroom:
|
||||||
ID: 40
|
ID: 40
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -414,11 +364,7 @@ Treasures:
|
|||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: true
|
Dirt: true
|
||||||
Grass: true
|
Grass: true
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: false
|
|
||||||
Mycelium: true
|
Mycelium: true
|
||||||
Soul_Sand: false
|
|
||||||
Brown_Mushroom:
|
Brown_Mushroom:
|
||||||
ID: 39
|
ID: 39
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -429,11 +375,7 @@ Treasures:
|
|||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: true
|
Dirt: true
|
||||||
Grass: true
|
Grass: true
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: false
|
|
||||||
Mycelium: true
|
Mycelium: true
|
||||||
Soul_Sand: false
|
|
||||||
Egg:
|
Egg:
|
||||||
ID: 344
|
ID: 344
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -442,13 +384,7 @@ Treasures:
|
|||||||
Drop_Chance: 1.0
|
Drop_Chance: 1.0
|
||||||
Drop_Level: 250
|
Drop_Level: 250
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: true
|
Grass: true
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: false
|
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Soul_Sand:
|
Soul_Sand:
|
||||||
ID: 88
|
ID: 88
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -457,13 +393,7 @@ Treasures:
|
|||||||
Drop_Chance: 0.5
|
Drop_Chance: 0.5
|
||||||
Drop_Level: 650
|
Drop_Level: 650
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: true
|
Sand: true
|
||||||
Gravel: false
|
|
||||||
Clay: false
|
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Clock:
|
Clock:
|
||||||
ID: 347
|
ID: 347
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -472,13 +402,7 @@ Treasures:
|
|||||||
Drop_Chance: 0.1
|
Drop_Chance: 0.1
|
||||||
Drop_Level: 500
|
Drop_Level: 500
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: true
|
Clay: true
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Cobweb:
|
Cobweb:
|
||||||
ID: 30
|
ID: 30
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -487,13 +411,7 @@ Treasures:
|
|||||||
Drop_Chance: 5.0
|
Drop_Chance: 5.0
|
||||||
Drop_Level: 750
|
Drop_Level: 750
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: true
|
Clay: true
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
String:
|
String:
|
||||||
ID: 287
|
ID: 287
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -502,13 +420,7 @@ Treasures:
|
|||||||
Drop_Chance: 5.0
|
Drop_Chance: 5.0
|
||||||
Drop_Level: 250
|
Drop_Level: 250
|
||||||
Drops_From:
|
Drops_From:
|
||||||
Dirt: false
|
|
||||||
Grass: false
|
|
||||||
Sand: false
|
|
||||||
Gravel: false
|
|
||||||
Clay: true
|
Clay: true
|
||||||
Mycelium: false
|
|
||||||
Soul_Sand: false
|
|
||||||
Glowstone_Dust:
|
Glowstone_Dust:
|
||||||
ID: 348
|
ID: 348
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -520,10 +432,7 @@ Treasures:
|
|||||||
Dirt: true
|
Dirt: true
|
||||||
Grass: true
|
Grass: true
|
||||||
Sand: true
|
Sand: true
|
||||||
Gravel: false
|
|
||||||
Clay: false
|
|
||||||
Mycelium: true
|
Mycelium: true
|
||||||
Soul_Sand: false
|
|
||||||
Gold_Music:
|
Gold_Music:
|
||||||
ID: 2256
|
ID: 2256
|
||||||
Data: 0
|
Data: 0
|
||||||
@ -584,6 +493,7 @@ Treasures:
|
|||||||
Clay: true
|
Clay: true
|
||||||
Mycelium: true
|
Mycelium: true
|
||||||
Soul_Sand: true
|
Soul_Sand: true
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for commands
|
# Settings for commands
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user