mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Started working on customizing Fishing drops
This commit is contained in:
parent
de0a6dd3ee
commit
8f3dce4ee9
@ -99,6 +99,7 @@ public class LoadProperties {
|
|||||||
public static List<ExcavationTreasure> excavationFromClay = new ArrayList<ExcavationTreasure>();
|
public static List<ExcavationTreasure> excavationFromClay = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<ExcavationTreasure> excavationFromMycel = new ArrayList<ExcavationTreasure>();
|
public static List<ExcavationTreasure> excavationFromMycel = new ArrayList<ExcavationTreasure>();
|
||||||
public static List<ExcavationTreasure> excavationFromSoulSand = new ArrayList<ExcavationTreasure>();
|
public static List<ExcavationTreasure> excavationFromSoulSand = new ArrayList<ExcavationTreasure>();
|
||||||
|
public static List<FishingTreasure> fishingRewards = new ArrayList<FishingTreasure>();
|
||||||
|
|
||||||
public static HUDType defaulthud;
|
public static HUDType defaulthud;
|
||||||
protected static File configFile;
|
protected static File configFile;
|
||||||
@ -439,7 +440,9 @@ public class LoadProperties {
|
|||||||
ItemStack item = new ItemStack(id, amount, (byte) 0, (byte) data);
|
ItemStack item = new ItemStack(id, amount, (byte) 0, (byte) data);
|
||||||
|
|
||||||
if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) {
|
if(readBoolean("Treasures." + treasureName + ".Drops_From.Fishing", false)) {
|
||||||
// TODO: Fishing
|
int maxLevel = config.getInt("Treasures." + treasureName + ".Max_Levels");
|
||||||
|
FishingTreasure fTreasure = new FishingTreasure(item, xp, dropChance, dropLevel, maxLevel);
|
||||||
|
treasures.put(treasureName, fTreasure);
|
||||||
} else {
|
} else {
|
||||||
ExcavationTreasure eTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel);
|
ExcavationTreasure eTreasure = new ExcavationTreasure(item, xp, dropChance, dropLevel);
|
||||||
if(readBoolean("Treasures." + treasureName + ".Drops_From.Dirt", false))
|
if(readBoolean("Treasures." + treasureName + ".Drops_From.Dirt", false))
|
||||||
@ -462,6 +465,7 @@ public class LoadProperties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<String> excavationTreasures = config.getStringList("Excavation.Treasure");
|
List<String> excavationTreasures = config.getStringList("Excavation.Treasure");
|
||||||
|
List<String> fishingTreasures = config.getStringList("Excavation.Treasure");
|
||||||
|
|
||||||
Iterator<String> treasureIterator = treasures.keySet().iterator();
|
Iterator<String> treasureIterator = treasures.keySet().iterator();
|
||||||
while(treasureIterator.hasNext()) {
|
while(treasureIterator.hasNext()) {
|
||||||
@ -469,7 +473,11 @@ public class LoadProperties {
|
|||||||
Treasure treasure = treasures.get(treasureKey);
|
Treasure treasure = treasures.get(treasureKey);
|
||||||
|
|
||||||
if(treasure instanceof FishingTreasure) {
|
if(treasure instanceof FishingTreasure) {
|
||||||
// TODO: Fishing
|
if(!fishingTreasures.contains(treasureKey)) continue;
|
||||||
|
|
||||||
|
FishingTreasure fTreasure = (FishingTreasure) treasure;
|
||||||
|
fishingRewards.add(fTreasure);
|
||||||
|
|
||||||
} else if(treasure instanceof ExcavationTreasure) {
|
} else if(treasure instanceof ExcavationTreasure) {
|
||||||
if(!excavationTreasures.contains(treasureKey)) continue;
|
if(!excavationTreasures.contains(treasureKey)) continue;
|
||||||
|
|
||||||
|
@ -3,10 +3,21 @@ package com.gmail.nossr50.datatypes.treasure;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class FishingTreasure extends Treasure {
|
public class FishingTreasure extends Treasure {
|
||||||
|
|
||||||
|
private int maxLevel;
|
||||||
|
|
||||||
public FishingTreasure(ItemStack drop, int xp, Double dropChance, int dropLevel) {
|
public FishingTreasure(ItemStack drop, int xp, Double dropChance, int dropLevel, int maxLevel) {
|
||||||
super(drop, xp, dropChance, dropLevel);
|
super(drop, xp, dropChance, dropLevel);
|
||||||
|
this.setMaxLevel(maxLevel);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMaxLevel() {
|
||||||
|
return maxLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxLevel(int maxLevel) {
|
||||||
|
this.maxLevel = maxLevel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user