mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-26 18:47:57 +01:00
Add sapling types
This commit is contained in:
parent
24f8b2fbd5
commit
755787f9ee
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.TreeSpecies;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -314,7 +315,10 @@ public class TreasureConfig extends ConfigLoader {
|
||||
if (dropper.equals("Bushes")) {
|
||||
AddHylianTreasure("Small_Fern", hylianTreasure);
|
||||
AddHylianTreasure("Small_Grass", hylianTreasure);
|
||||
AddHylianTreasure(StringUtils.getPrettyItemString(Material.SAPLING), hylianTreasure);
|
||||
for (TreeSpecies species : TreeSpecies.values()) {
|
||||
AddHylianTreasure(StringUtils.getPrettyTreeSpeciesString(species) + "_Sapling", hylianTreasure);
|
||||
}
|
||||
|
||||
AddHylianTreasure(StringUtils.getPrettyItemString(Material.DEAD_BUSH), hylianTreasure);
|
||||
continue;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.material.Crops;
|
||||
import org.bukkit.material.LongGrass;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.material.NetherWarts;
|
||||
import org.bukkit.material.Sapling;
|
||||
import org.bukkit.material.Tree;
|
||||
import org.bukkit.material.CocoaPlant.CocoaPlantSize;
|
||||
|
||||
@ -292,19 +293,28 @@ public class StringUtils {
|
||||
if (((Crops) data).getState() == CropState.RIPE) {
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_");
|
||||
}
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_") + "_UNGROWN";
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_") + "_Ungrown";
|
||||
}
|
||||
case NETHER_WARTS : {
|
||||
if (((NetherWarts) data).getState() == NetherWartsState.RIPE) {
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_");
|
||||
}
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_") + "_UNGROWN";
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_") + "_Ungrown";
|
||||
}
|
||||
case COCOA : {
|
||||
if (((CocoaPlant) data).getSize() == CocoaPlantSize.LARGE) {
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_");
|
||||
}
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_") + "_UNGROWN";
|
||||
return getPrettyItemString(data.getItemType()).replace(" ", "_") + "_Ungrown";
|
||||
}
|
||||
case SAPLING:
|
||||
{
|
||||
TreeSpecies species = TreeSpecies.GENERIC;
|
||||
if (data instanceof Sapling) {
|
||||
Sapling sapling = (Sapling) data;
|
||||
species = sapling.getSpecies();
|
||||
}
|
||||
return createPrettyEnumString(species.name()).replace(" ", "_") + "_Sapling";
|
||||
}
|
||||
case SMOOTH_BRICK :
|
||||
case WOOL :
|
||||
|
Loading…
Reference in New Issue
Block a user