mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-24 19:45:14 +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;
|
package world.bentobox.challenges;
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
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.ConfigComment;
|
||||||
import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
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.api.configuration.StoreAt;
|
||||||
import world.bentobox.bentobox.database.objects.DataObject;
|
|
||||||
|
|
||||||
|
|
||||||
@StoreAt(filename="config.yml", path="addons/Challenges")
|
@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("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("be lost! Use in-game settings GUI or edit when server is offline.")
|
||||||
@ConfigComment("")
|
@ConfigComment("")
|
||||||
public class Settings implements DataObject
|
public class Settings implements ConfigObject
|
||||||
{
|
{
|
||||||
@ConfigComment("")
|
@ConfigComment("")
|
||||||
@ConfigComment("Allows to define common challenges command that will open User GUI")
|
@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")
|
@ConfigEntry(path = "disabled-gamemodes")
|
||||||
private Set<String> disabledGameModes = new HashSet<>();
|
private Set<String> disabledGameModes = new HashSet<>();
|
||||||
|
|
||||||
/**
|
|
||||||
* Default variable.
|
|
||||||
*/
|
|
||||||
@ConfigComment("")
|
|
||||||
private String uniqueId = "config";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration version
|
* Configuration version
|
||||||
*/
|
*/
|
||||||
@ -200,13 +195,6 @@ public class Settings implements DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getUniqueId()
|
|
||||||
{
|
|
||||||
return this.uniqueId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return resetChallenges value.
|
* @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.
|
* This method sets the challengeLoreMessage object value.
|
||||||
* @param challengeLoreMessage the challengeLoreMessage object new value.
|
* @param challengeLoreMessage the challengeLoreMessage object new value.
|
||||||
|
@ -311,7 +311,7 @@ public class Challenge implements DataObject
|
|||||||
*/
|
*/
|
||||||
public ItemStack getIcon()
|
public ItemStack getIcon()
|
||||||
{
|
{
|
||||||
return icon.clone();
|
return icon !=null ? icon.clone() : new ItemStack(Material.PAPER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user