Allow treasure chests to be placed in other locations instead of fixing them in the main hub's configuration

This commit is contained in:
AlexTheCoder 2016-07-25 10:57:15 -04:00
parent 25b0ae5916
commit 979bb92034

View File

@ -4,11 +4,13 @@ import java.util.ArrayList;
import java.util.List;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
@ -121,13 +123,21 @@ public class TreasureManager extends MiniPlugin
for (TreasureLocation treasureLocation : _treasureLocations)
{
treasureLocation.cleanup();
HandlerList.unregisterAll(treasureLocation);
}
_treasureLocations.clear();
}
public void addOpenStat(Player player, TreasureType treasureType)
{
_statsManager.incrementStat(player, "Global.Treasure." + treasureType.getStatName(), 1);
}
public void addTreasureLocation(TreasureLocation loc)
{
_treasureLocations.add(loc);
_plugin.getServer().getPluginManager().registerEvents(loc, _plugin);
}
public Reward[] getRewards(Player player, RewardPool.Type pool, RewardType rewardType)
{