Removed commands that will be done via GUI.

This commit is contained in:
tastybento 2018-08-18 14:40:56 -07:00
parent 9dd0e12878
commit 13a887d1b9
17 changed files with 15 additions and 856 deletions

View File

@ -24,7 +24,7 @@ import bentobox.addon.challenges.commands.admin.SurroundChallengeBuilder;
import bentobox.addon.challenges.database.object.ChallengeLevels;
import bentobox.addon.challenges.database.object.Challenges;
import bentobox.addon.challenges.database.object.Challenges.ChallengeType;
import bentobox.addon.challenges.database.object.PlayerData;
import bentobox.addon.challenges.database.object.ChallengesPlayerData;
import bentobox.addon.challenges.panel.ChallengesPanels;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.user.User;
@ -37,9 +37,9 @@ public class ChallengesManager {
private Map<ChallengeLevels, Set<Challenges>> challengeMap;
private Config<Challenges> chConfig;
private Config<ChallengeLevels> lvConfig;
private Database<PlayerData> players;
private Database<ChallengesPlayerData> players;
private ChallengesPanels challengesPanels;
private Map<UUID,PlayerData> playerData;
private Map<UUID,ChallengesPlayerData> playerData;
private ChallengesAddon addon;
public ChallengesManager(ChallengesAddon addon) {
@ -48,7 +48,7 @@ public class ChallengesManager {
chConfig = new Config<>(addon, Challenges.class);
lvConfig = new Config<>(addon, ChallengeLevels.class);
// Players is where all the player history will be stored
players = new Database<>(addon, PlayerData.class);
players = new Database<>(addon, ChallengesPlayerData.class);
// Cache of challenges
challengeMap = new LinkedHashMap<>();
// Cache of player data
@ -68,12 +68,12 @@ public class ChallengesManager {
// Check if the player exists in the database
if (players.objectExists(user.getUniqueId().toString())) {
// Load player from database
PlayerData data = players.loadObject(user.getUniqueId().toString());
ChallengesPlayerData data = players.loadObject(user.getUniqueId().toString());
// Store in cache
playerData.put(user.getUniqueId(), data);
} else {
// Create the player data
PlayerData pd = new PlayerData(user.getUniqueId().toString());
ChallengesPlayerData pd = new ChallengesPlayerData(user.getUniqueId().toString());
players.saveObject(pd);
// Add to cache
playerData.put(user.getUniqueId(), pd);
@ -215,7 +215,7 @@ public class ChallengesManager {
*/
public List<LevelStatus> getChallengeLevelStatus(User user, World world) {
addPlayer(user);
PlayerData pd = playerData.get(user.getUniqueId());
ChallengesPlayerData pd = playerData.get(user.getUniqueId());
List<LevelStatus> result = new ArrayList<>();
ChallengeLevels previousLevel = null;
// The first level is always unlocked

View File

@ -24,7 +24,7 @@ public class Challenges extends CompositeCommand {
this.setDescription("challenges.admin.description");
// Register sub commands
new ImportCommand(getAddon(), this);
new ShowChallenges(getAddon(), this);
//new ShowChallenges(getAddon(), this);
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class MakeLevel extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public MakeLevel(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public MakeLevel(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public MakeLevel(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetDeployed extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetDeployed(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetDeployed(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetDeployed(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetDescription extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetDescription(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetDescription(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetDescription(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetExp extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetExp(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetExp(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetExp(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetFriendlyName extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetFriendlyName(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetFriendlyName(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetFriendlyName(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,63 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import org.bukkit.inventory.ItemStack;
import bentobox.addon.challenges.ChallengesAddon;
import bentobox.addon.challenges.database.object.Challenges;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetIcon extends CompositeCommand {
private ChallengesAddon addon;
/**
* @param parent
* @param label
* @param aliases
*/
public SetIcon(ChallengesAddon addon, CompositeCommand parent) {
super(parent, "seticon");
this.addon = addon;
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
setParametersHelp("challenges.admin.seticon.parameters");
setDescription("challenges.admin.seticon.description");
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
ItemStack icon = user.getInventory().getItemInMainHand();
if (args.isEmpty() || icon == null) {
user.sendMessage("challenges.admin.seticon.description");
return false;
}
Challenges challenge = addon.getChallengesManager().getChallenge(args.get(0), getWorld());
// Check if this challenge name exists
if (challenge == null) {
user.sendMessage("challenges.admin.seticon.error.no-such-challenge");
return false;
}
challenge.setIcon(icon);
user.sendMessage("general.success");
return true;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetLevel extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetLevel(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetLevel(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetLevel(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetMaxTimes extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetMaxTimes(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetMaxTimes(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetMaxTimes(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetPerm extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetPerm(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetPerm(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetPerm(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetRepeatable extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetRepeatable(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetRepeatable(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetRepeatable(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetReward extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetReward(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetReward(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetReward(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class SetType extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public SetType(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public SetType(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public SetType(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -1,65 +0,0 @@
/**
*
*/
package bentobox.addon.challenges.commands.admin;
import java.util.List;
import bentobox.addon.challenges.ChallengesAddon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* @author tastybento
*
*/
public class TakeItems extends CompositeCommand {
/**
* @param plugin
* @param label
* @param string
*/
public TakeItems(ChallengesAddon plugin, String label, String... string) {
super(plugin, label, string);
// TODO Auto-generated constructor stub
}
/**
* @param parent
* @param label
* @param aliases
*/
public TakeItems(CompositeCommand parent, String label, String... aliases) {
super(parent, label, aliases);
// TODO Auto-generated constructor stub
}
/**
* @param label
* @param aliases
*/
public TakeItems(String label, String... aliases) {
super(label, aliases);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
*/
@Override
public void setup() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
*/
@Override
public boolean execute(User user, String label, List<String> args) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -20,7 +20,7 @@ import world.bentobox.bentobox.util.Util;
* @author tastybento
*
*/
public class PlayerData implements DataObject {
public class ChallengesPlayerData implements DataObject {
@Expose
private String uniqueId = "";
@ -35,7 +35,7 @@ public class PlayerData implements DataObject {
private Set<String> levelsDone = new HashSet<>();
// Required for bean instantiation
public PlayerData() {}
public ChallengesPlayerData() {}
/**
* Mark a challenge as having been completed. Will increment the number of times and timestamp
@ -70,7 +70,7 @@ public class PlayerData implements DataObject {
* Creates a player data entry
* @param uniqueId - the player's UUID in string format
*/
public PlayerData(String uniqueId) {
public ChallengesPlayerData(String uniqueId) {
this.uniqueId = uniqueId;
}
@ -150,10 +150,10 @@ public class PlayerData implements DataObject {
if (obj == null) {
return false;
}
if (!(obj instanceof PlayerData)) {
if (!(obj instanceof ChallengesPlayerData)) {
return false;
}
PlayerData other = (PlayerData) obj;
ChallengesPlayerData other = (ChallengesPlayerData) obj;
if (uniqueId == null) {
if (other.uniqueId != null) {
return false;

View File

@ -4,6 +4,8 @@ version: 0.1
authors: tastybento
softdepend: AcidIsland, BSkyBlock
permissions:
bskyblock.challenges:
description: Let the player use the /challenges command