Update to BentoBox 1.14 API
Uses short table names for SQL DB's and async DB saving methods
This commit is contained in:
parent
679fe48871
commit
0aa89accdd
4
pom.xml
4
pom.xml
|
@ -36,13 +36,13 @@
|
|||
<powermock.version>2.0.2</powermock.version>
|
||||
<!-- More visible way how to change dependency versions -->
|
||||
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
|
||||
<bentobox.version>1.13.1</bentobox.version>
|
||||
<bentobox.version>1.14.0-SNAPSHOT</bentobox.version>
|
||||
<level.version>1.6.0</level.version>
|
||||
<vault.version>1.7</vault.version>
|
||||
<!-- Revision variable removes warning about dynamic version -->
|
||||
<revision>${build.version}-SNAPSHOT</revision>
|
||||
<!-- This allows to change between versions and snapshots. -->
|
||||
<build.version>0.9.0</build.version>
|
||||
<build.version>0.10.0</build.version>
|
||||
<build.number>-LOCAL</build.number>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -402,27 +402,6 @@ public class ChallengesManager
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method stores PlayerData into local cache.
|
||||
*
|
||||
* @param playerData ChallengesPlayerData that must be loaded.
|
||||
*
|
||||
* TODO: Remove this unused method?
|
||||
*/
|
||||
private void loadPlayerData(@NonNull ChallengesPlayerData playerData)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.playerCacheData.put(playerData.getUniqueId(), playerData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.addon.getLogger().severe("UUID for player in challenge data file is invalid!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method removes given player from cache data.
|
||||
*
|
||||
|
@ -549,7 +528,7 @@ public class ChallengesManager
|
|||
{
|
||||
// Create the player data
|
||||
ChallengesPlayerData pd = new ChallengesPlayerData(uniqueID);
|
||||
this.playersDatabase.saveObject(pd);
|
||||
this.playersDatabase.saveObjectAsync(pd);
|
||||
// Add to cache
|
||||
this.playerCacheData.put(uniqueID, pd);
|
||||
}
|
||||
|
@ -696,7 +675,7 @@ public class ChallengesManager
|
|||
challengesID.forEach(challenge ->
|
||||
level.getChallenges().add(addonName + challenge.substring(world.getName().length())));
|
||||
|
||||
this.levelDatabase.saveObject(level);
|
||||
this.levelDatabase.saveObjectAsync(level);
|
||||
this.levelCacheData.put(level.getUniqueId(), level);
|
||||
|
||||
updated = true;
|
||||
|
@ -740,7 +719,7 @@ public class ChallengesManager
|
|||
|
||||
updated = true;
|
||||
|
||||
this.challengeDatabase.saveObject(challenge);
|
||||
this.challengeDatabase.saveObjectAsync(challenge);
|
||||
this.challengeCacheData.put(challenge.getUniqueId(), challenge);
|
||||
}
|
||||
|
||||
|
@ -783,7 +762,7 @@ public class ChallengesManager
|
|||
|
||||
// This save should not involve any upgrades in other parts.
|
||||
|
||||
this.challengeDatabase.saveObject(challenge);
|
||||
this.challengeDatabase.saveObjectAsync(challenge);
|
||||
this.challengeCacheData.put(challenge.getUniqueId(), challenge);
|
||||
}
|
||||
}
|
||||
|
@ -834,7 +813,7 @@ public class ChallengesManager
|
|||
}
|
||||
});
|
||||
|
||||
this.playersDatabase.saveObject(playerData);
|
||||
this.playersDatabase.saveObjectAsync(playerData);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import com.google.gson.annotations.Expose;
|
|||
import com.google.gson.annotations.JsonAdapter;
|
||||
|
||||
import world.bentobox.bentobox.database.objects.DataObject;
|
||||
import world.bentobox.bentobox.database.objects.Table;
|
||||
import world.bentobox.challenges.database.object.adapters.RequirementsAdapter;
|
||||
import world.bentobox.challenges.database.object.requirements.Requirements;
|
||||
|
||||
|
@ -28,6 +29,7 @@ import world.bentobox.challenges.database.object.requirements.Requirements;
|
|||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
@Table(name = "Challenge")
|
||||
public class Challenge implements DataObject
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.google.gson.annotations.Expose;
|
|||
|
||||
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||
import world.bentobox.bentobox.database.objects.DataObject;
|
||||
import world.bentobox.bentobox.database.objects.Table;
|
||||
import world.bentobox.challenges.ChallengesManager;
|
||||
|
||||
/**
|
||||
|
@ -21,6 +22,7 @@ import world.bentobox.challenges.ChallengesManager;
|
|||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
@Table(name = "ChallengeLevel")
|
||||
public class ChallengeLevel implements DataObject, Comparable<ChallengeLevel>
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.google.gson.annotations.Expose;
|
|||
|
||||
import world.bentobox.bentobox.api.logs.LogEntry;
|
||||
import world.bentobox.bentobox.database.objects.DataObject;
|
||||
import world.bentobox.bentobox.database.objects.Table;
|
||||
import world.bentobox.bentobox.database.objects.adapters.Adapter;
|
||||
import world.bentobox.bentobox.database.objects.adapters.LogEntryListAdapter;
|
||||
|
||||
|
@ -23,6 +24,7 @@ import world.bentobox.bentobox.database.objects.adapters.LogEntryListAdapter;
|
|||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
@Table(name = "ChallengesPlayerData")
|
||||
public class ChallengesPlayerData implements DataObject
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -263,7 +263,6 @@ public abstract class CommonGUI
|
|||
* @param button Button that must be returned.
|
||||
* @return PanelItem with requested functionality.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
protected PanelItem getButton(CommonButtons button)
|
||||
{
|
||||
ItemStack icon;
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
package world.bentobox.challenges.panel.admin;
|
||||
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.conversations.*;
|
||||
import org.bukkit.conversations.Conversation;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import org.bukkit.conversations.ValidatingPrompt;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: Challenges
|
||||
main: world.bentobox.challenges.ChallengesAddon
|
||||
version: ${version}${build.number}
|
||||
api-version: 1.13.1
|
||||
api-version: 1.14
|
||||
repository: 'BentoBoxWorld/Challenges'
|
||||
metrics: true
|
||||
|
||||
|
|
Loading…
Reference in New Issue