Search in sources :

Example 1 with CustomTreasureChestConfigFields

use of com.magmaguy.elitemobs.config.customtreasurechests.CustomTreasureChestConfigFields in project EliteMobs by MagmaGuy.

the class Minidungeon method addRelativeTreasureChest.

public Location addRelativeTreasureChest(String customTreasureChestConfigString, Location location, Player player) {
    if (dungeonPackagerConfigFields.getAnchorPoint() == null)
        return null;
    CustomTreasureChestConfigFields customTreasureChestConfigFields = CustomTreasureChestsConfig.getCustomTreasureChestConfigFields().get(customTreasureChestConfigString);
    if (customTreasureChestConfigFields == null)
        return null;
    Location relativeLocation = location.clone().subtract(dungeonPackagerConfigFields.getAnchorPoint());
    CustomTreasureChestsConfig.addTreasureChestEntry(player, customTreasureChestConfigString);
    if (dungeonPackagerConfigFields.addRelativeTreasureChests(customTreasureChestConfigFields, relativeLocation))
        return relativeLocation;
    else
        return null;
}
Also used : CustomTreasureChestConfigFields(com.magmaguy.elitemobs.config.customtreasurechests.CustomTreasureChestConfigFields) Location(org.bukkit.Location)

Aggregations

CustomTreasureChestConfigFields (com.magmaguy.elitemobs.config.customtreasurechests.CustomTreasureChestConfigFields)1 Location (org.bukkit.Location)1