mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-28 05:25:21 +01:00
Changes to fit new API for database transition. (#114)
Config files must implement the ConfigObject interface now instead of DataObject. They no longer need to specify uniqueId.
This commit is contained in:
parent
ff6e28b27e
commit
a25796613f
@ -1,15 +1,16 @@
|
||||
package world.bentobox.challenges;
|
||||
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||
import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
||||
import world.bentobox.bentobox.api.configuration.ConfigObject;
|
||||
import world.bentobox.bentobox.api.configuration.StoreAt;
|
||||
import world.bentobox.bentobox.database.objects.DataObject;
|
||||
|
||||
|
||||
@StoreAt(filename="config.yml", path="addons/Challenges")
|
||||
@ -18,7 +19,7 @@ import world.bentobox.bentobox.database.objects.DataObject;
|
||||
@ConfigComment("You cannot edit it while the server is running because changes will")
|
||||
@ConfigComment("be lost! Use in-game settings GUI or edit when server is offline.")
|
||||
@ConfigComment("")
|
||||
public class Settings implements DataObject
|
||||
public class Settings implements ConfigObject
|
||||
{
|
||||
@ConfigComment("")
|
||||
@ConfigComment("Allows to define common challenges command that will open User GUI")
|
||||
@ -162,12 +163,6 @@ public class Settings implements DataObject
|
||||
@ConfigEntry(path = "disabled-gamemodes")
|
||||
private Set<String> disabledGameModes = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Default variable.
|
||||
*/
|
||||
@ConfigComment("")
|
||||
private String uniqueId = "config";
|
||||
|
||||
/**
|
||||
* Configuration version
|
||||
*/
|
||||
@ -200,13 +195,6 @@ public class Settings implements DataObject
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUniqueId()
|
||||
{
|
||||
return this.uniqueId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return resetChallenges value.
|
||||
*/
|
||||
@ -434,13 +422,6 @@ public class Settings implements DataObject
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setUniqueId(String uniqueId)
|
||||
{
|
||||
this.uniqueId = uniqueId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method sets the challengeLoreMessage object value.
|
||||
* @param challengeLoreMessage the challengeLoreMessage object new value.
|
||||
|
@ -311,7 +311,7 @@ public class Challenge implements DataObject
|
||||
*/
|
||||
public ItemStack getIcon()
|
||||
{
|
||||
return icon.clone();
|
||||
return icon !=null ? icon.clone() : new ItemStack(Material.PAPER);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user