mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-30 22:53:39 +01:00
API Breaker: renamed BSB classes to be just BB
Hopefully, this is the last API breaker. I renamed the classes that started with BSB to be just BB (bentobox). I now have to fix all the add-ons I just broke...
This commit is contained in:
parent
cfdabbb176
commit
ba557a1068
@ -5,13 +5,13 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import world.bentobox.bentobox.api.configuration.BSBConfig;
|
import world.bentobox.bentobox.api.configuration.BBConfig;
|
||||||
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
||||||
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
||||||
import world.bentobox.bentobox.api.placeholders.PlaceholderHandler;
|
import world.bentobox.bentobox.api.placeholders.PlaceholderHandler;
|
||||||
import world.bentobox.bentobox.api.user.Notifier;
|
import world.bentobox.bentobox.api.user.Notifier;
|
||||||
import world.bentobox.bentobox.commands.BentoBoxCommand;
|
import world.bentobox.bentobox.commands.BentoBoxCommand;
|
||||||
import world.bentobox.bentobox.database.BSBDbSetup;
|
import world.bentobox.bentobox.database.BBDbSetup;
|
||||||
import world.bentobox.bentobox.listeners.BannedVisitorCommands;
|
import world.bentobox.bentobox.listeners.BannedVisitorCommands;
|
||||||
import world.bentobox.bentobox.listeners.BlockEndDragon;
|
import world.bentobox.bentobox.listeners.BlockEndDragon;
|
||||||
import world.bentobox.bentobox.listeners.JoinLeaveListener;
|
import world.bentobox.bentobox.listeners.JoinLeaveListener;
|
||||||
@ -78,7 +78,7 @@ public class BentoBox extends JavaPlugin {
|
|||||||
flagsManager = new FlagsManager(instance);
|
flagsManager = new FlagsManager(instance);
|
||||||
|
|
||||||
// Load settings from config.yml. This will check if there are any issues with it too.
|
// Load settings from config.yml. This will check if there are any issues with it too.
|
||||||
settings = new BSBConfig<>(this, Settings.class).loadConfigObject("");
|
settings = new BBConfig<>(this, Settings.class).loadConfigObject("");
|
||||||
// Start Database managers
|
// Start Database managers
|
||||||
playersManager = new PlayersManager(this);
|
playersManager = new PlayersManager(this);
|
||||||
// Check if this plugin is now disabled (due to bad database handling)
|
// Check if this plugin is now disabled (due to bad database handling)
|
||||||
@ -183,7 +183,7 @@ public class BentoBox extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Save settings
|
// Save settings
|
||||||
if (settings != null) {
|
if (settings != null) {
|
||||||
new BSBConfig<>(this, Settings.class).saveConfigObject(settings);
|
new BBConfig<>(this, Settings.class).saveConfigObject(settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ public class BentoBox extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return BSBDbSetup.getDatabase().toString();
|
return BBDbSetup.getDatabase().toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import java.util.Set;
|
|||||||
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.StoreAt;
|
import world.bentobox.bentobox.api.configuration.StoreAt;
|
||||||
import world.bentobox.bentobox.database.BSBDbSetup.DatabaseType;
|
import world.bentobox.bentobox.database.BBDbSetup.DatabaseType;
|
||||||
import world.bentobox.bentobox.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,17 +17,17 @@ import world.bentobox.bentobox.database.flatfile.FlatFileDatabase;
|
|||||||
*
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public class BSBConfig<T> {
|
public class BBConfig<T> {
|
||||||
|
|
||||||
private AbstractDatabaseHandler<T> handler;
|
private AbstractDatabaseHandler<T> handler;
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
public BSBConfig(BentoBox plugin, Class<T> type) {
|
public BBConfig(BentoBox plugin, Class<T> type) {
|
||||||
this.logger = plugin.getLogger();
|
this.logger = plugin.getLogger();
|
||||||
handler = new FlatFileDatabase().getHandler(type);
|
handler = new FlatFileDatabase().getHandler(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BSBConfig(Addon addon, Class<T> type) {
|
public BBConfig(Addon addon, Class<T> type) {
|
||||||
this.logger = addon.getLogger();
|
this.logger = addon.getLogger();
|
||||||
handler = new FlatFileDatabase().getHandler(type);
|
handler = new FlatFileDatabase().getHandler(type);
|
||||||
}
|
}
|
||||||
@ -64,6 +64,14 @@ public class BSBConfig<T> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a config object
|
||||||
|
* @return the object or null if it cannot be loaded
|
||||||
|
*/
|
||||||
|
public T loadConfigObject() {
|
||||||
|
return loadConfigObject("");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save config object
|
* Save config object
|
||||||
* @param instance to save
|
* @param instance to save
|
@ -15,19 +15,19 @@ import world.bentobox.bentobox.api.addons.Addon;
|
|||||||
*
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public class BSBDatabase<T> {
|
public class BBDatabase<T> {
|
||||||
|
|
||||||
private AbstractDatabaseHandler<T> handler;
|
private AbstractDatabaseHandler<T> handler;
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
public BSBDatabase(BentoBox plugin, Class<T> type) {
|
public BBDatabase(BentoBox plugin, Class<T> type) {
|
||||||
this.logger = plugin.getLogger();
|
this.logger = plugin.getLogger();
|
||||||
handler = BSBDbSetup.getDatabase().getHandler(type);
|
handler = BBDbSetup.getDatabase().getHandler(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BSBDatabase(Addon addon, Class<T> type) {
|
public BBDatabase(Addon addon, Class<T> type) {
|
||||||
this.logger = addon.getLogger();
|
this.logger = addon.getLogger();
|
||||||
handler = BSBDbSetup.getDatabase().getHandler(type);
|
handler = BBDbSetup.getDatabase().getHandler(type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,14 +5,14 @@ import world.bentobox.bentobox.database.flatfile.FlatFileDatabase;
|
|||||||
import world.bentobox.bentobox.database.mongodb.MongoDBDatabase;
|
import world.bentobox.bentobox.database.mongodb.MongoDBDatabase;
|
||||||
import world.bentobox.bentobox.database.mysql.MySQLDatabase;
|
import world.bentobox.bentobox.database.mysql.MySQLDatabase;
|
||||||
|
|
||||||
public abstract class BSBDbSetup {
|
public abstract class BBDbSetup {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the type of database being used. Currently supported options are
|
* Gets the type of database being used. Currently supported options are
|
||||||
* FLATFILE and MYSQL. Default is FLATFILE
|
* FLATFILE and MYSQL. Default is FLATFILE
|
||||||
* @return Database type
|
* @return Database type
|
||||||
*/
|
*/
|
||||||
public static BSBDbSetup getDatabase(){
|
public static BBDbSetup getDatabase(){
|
||||||
for(DatabaseType type : DatabaseType.values()){
|
for(DatabaseType type : DatabaseType.values()){
|
||||||
if(type == BentoBox.getInstance().getSettings().getDatabaseType()) {
|
if(type == BentoBox.getInstance().getSettings().getDatabaseType()) {
|
||||||
return type.database;
|
return type.database;
|
||||||
@ -26,9 +26,9 @@ public abstract class BSBDbSetup {
|
|||||||
MYSQL(new MySQLDatabase()),
|
MYSQL(new MySQLDatabase()),
|
||||||
MONGO(new MongoDBDatabase());
|
MONGO(new MongoDBDatabase());
|
||||||
|
|
||||||
BSBDbSetup database;
|
BBDbSetup database;
|
||||||
|
|
||||||
DatabaseType(BSBDbSetup database){
|
DatabaseType(BBDbSetup database){
|
||||||
this.database = database;
|
this.database = database;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,9 +2,9 @@ package world.bentobox.bentobox.database.flatfile;
|
|||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
||||||
import world.bentobox.bentobox.database.BSBDbSetup;
|
import world.bentobox.bentobox.database.BBDbSetup;
|
||||||
|
|
||||||
public class FlatFileDatabase extends BSBDbSetup{
|
public class FlatFileDatabase extends BBDbSetup{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the config
|
* Get the config
|
||||||
|
@ -2,10 +2,10 @@ package world.bentobox.bentobox.database.mongodb;
|
|||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
||||||
import world.bentobox.bentobox.database.BSBDbSetup;
|
import world.bentobox.bentobox.database.BBDbSetup;
|
||||||
import world.bentobox.bentobox.database.DatabaseConnectionSettingsImpl;
|
import world.bentobox.bentobox.database.DatabaseConnectionSettingsImpl;
|
||||||
|
|
||||||
public class MongoDBDatabase extends BSBDbSetup{
|
public class MongoDBDatabase extends BBDbSetup{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> AbstractDatabaseHandler<T> getHandler(Class<T> type) {
|
public <T> AbstractDatabaseHandler<T> getHandler(Class<T> type) {
|
||||||
|
@ -2,10 +2,10 @@ package world.bentobox.bentobox.database.mysql;
|
|||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
||||||
import world.bentobox.bentobox.database.BSBDbSetup;
|
import world.bentobox.bentobox.database.BBDbSetup;
|
||||||
import world.bentobox.bentobox.database.DatabaseConnectionSettingsImpl;
|
import world.bentobox.bentobox.database.DatabaseConnectionSettingsImpl;
|
||||||
|
|
||||||
public class MySQLDatabase extends BSBDbSetup{
|
public class MySQLDatabase extends BBDbSetup{
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -25,7 +25,7 @@ import org.bukkit.util.Vector;
|
|||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.BSBDatabase;
|
import world.bentobox.bentobox.database.BBDatabase;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.lists.Flags;
|
import world.bentobox.bentobox.lists.Flags;
|
||||||
import world.bentobox.bentobox.managers.island.IslandCache;
|
import world.bentobox.bentobox.managers.island.IslandCache;
|
||||||
@ -50,7 +50,7 @@ public class IslandsManager {
|
|||||||
*/
|
*/
|
||||||
private Map<World, Island> spawn;
|
private Map<World, Island> spawn;
|
||||||
|
|
||||||
private BSBDatabase<Island> handler;
|
private BBDatabase<Island> handler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The last locations where an island were put.
|
* The last locations where an island were put.
|
||||||
@ -73,7 +73,7 @@ public class IslandsManager {
|
|||||||
public IslandsManager(BentoBox plugin){
|
public IslandsManager(BentoBox plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
// Set up the database handler to store and retrieve Island classes
|
// Set up the database handler to store and retrieve Island classes
|
||||||
handler = new BSBDatabase<>(plugin, Island.class);
|
handler = new BBDatabase<>(plugin, Island.class);
|
||||||
islandCache = new IslandCache();
|
islandCache = new IslandCache();
|
||||||
spawn = new HashMap<>();
|
spawn = new HashMap<>();
|
||||||
last = new HashMap<>();
|
last = new HashMap<>();
|
||||||
|
@ -14,15 +14,15 @@ import org.bukkit.World;
|
|||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.BSBDatabase;
|
import world.bentobox.bentobox.database.BBDatabase;
|
||||||
import world.bentobox.bentobox.database.objects.Names;
|
import world.bentobox.bentobox.database.objects.Names;
|
||||||
import world.bentobox.bentobox.database.objects.Players;
|
import world.bentobox.bentobox.database.objects.Players;
|
||||||
|
|
||||||
public class PlayersManager {
|
public class PlayersManager {
|
||||||
|
|
||||||
private BentoBox plugin;
|
private BentoBox plugin;
|
||||||
private BSBDatabase<Players> handler;
|
private BBDatabase<Players> handler;
|
||||||
private BSBDatabase<Names> names;
|
private BBDatabase<Names> names;
|
||||||
|
|
||||||
private Map<UUID, Players> playerCache;
|
private Map<UUID, Players> playerCache;
|
||||||
private Set<UUID> inTeleport;
|
private Set<UUID> inTeleport;
|
||||||
@ -37,9 +37,9 @@ public class PlayersManager {
|
|||||||
public PlayersManager(BentoBox plugin){
|
public PlayersManager(BentoBox plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
// Set up the database handler to store and retrieve Players classes
|
// Set up the database handler to store and retrieve Players classes
|
||||||
handler = new BSBDatabase<>(plugin, Players.class);
|
handler = new BBDatabase<>(plugin, Players.class);
|
||||||
// Set up the names database
|
// Set up the names database
|
||||||
names = new BSBDatabase<>(plugin, Names.class);
|
names = new BBDatabase<>(plugin, Names.class);
|
||||||
playerCache = new HashMap<>();
|
playerCache = new HashMap<>();
|
||||||
inTeleport = new HashSet<>();
|
inTeleport = new HashSet<>();
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ public class PlayersManager {
|
|||||||
* Used only for testing. Sets the database to a mock database.
|
* Used only for testing. Sets the database to a mock database.
|
||||||
* @param handler - handler
|
* @param handler - handler
|
||||||
*/
|
*/
|
||||||
public void setHandler(BSBDatabase<Players> handler) {
|
public void setHandler(BBDatabase<Players> handler) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.AdminClearResetsAllCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
import world.bentobox.bentobox.managers.IslandWorldManager;
|
import world.bentobox.bentobox.managers.IslandWorldManager;
|
||||||
|
@ -29,7 +29,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.AdminInfoCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -16,7 +16,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -17,7 +17,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
@ -27,7 +26,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.range.AdminRangeDisplayCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
import world.bentobox.bentobox.managers.IslandWorldManager;
|
import world.bentobox.bentobox.managers.IslandWorldManager;
|
||||||
|
@ -20,7 +20,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -20,7 +20,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -26,7 +26,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamAddCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -28,7 +28,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamDisbandCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -30,7 +30,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamKickCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -28,7 +28,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamMakeLeaderCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -8,7 +8,17 @@ import static org.junit.Assert.assertTrue;
|
|||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -18,7 +28,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
@ -28,7 +37,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.IslandBanCommand;
|
|
||||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
|
@ -8,7 +8,13 @@ import static org.junit.Assert.assertTrue;
|
|||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -17,7 +23,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
@ -27,7 +32,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.IslandBanlistCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -29,7 +29,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.IslandGoCommand;
|
|
||||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
|
@ -30,7 +30,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.IslandResetCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
|
@ -8,7 +8,16 @@ import static org.junit.Assert.assertTrue;
|
|||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -25,7 +34,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.IslandUnbanCommand;
|
|
||||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
|
@ -29,7 +29,6 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.commands.island.team.IslandTeamLeaveCommand;
|
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.managers.CommandsManager;
|
import world.bentobox.bentobox.managers.CommandsManager;
|
||||||
import world.bentobox.bentobox.managers.IslandWorldManager;
|
import world.bentobox.bentobox.managers.IslandWorldManager;
|
||||||
|
@ -26,7 +26,6 @@ import org.junit.BeforeClass;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -23,7 +23,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
import org.powermock.modules.junit4.PowerMockRunner;
|
import org.powermock.modules.junit4.PowerMockRunner;
|
||||||
|
@ -39,7 +39,6 @@ import org.junit.BeforeClass;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -31,7 +31,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -28,7 +28,6 @@ import org.bukkit.entity.Slime;
|
|||||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
import org.bukkit.event.entity.EntityDeathEvent;
|
import org.bukkit.event.entity.EntityDeathEvent;
|
||||||
import org.bukkit.inventory.ItemFactory;
|
import org.bukkit.inventory.ItemFactory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -27,7 +27,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -10,7 +10,14 @@ import static org.mockito.Matchers.any;
|
|||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -41,7 +48,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -43,7 +43,6 @@ import org.junit.Test;
|
|||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Matchers;
|
import org.mockito.Matchers;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -42,7 +42,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
@ -34,7 +34,7 @@ import org.powermock.reflect.Whitebox;
|
|||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.BSBDatabase;
|
import world.bentobox.bentobox.database.BBDatabase;
|
||||||
import world.bentobox.bentobox.database.objects.Players;
|
import world.bentobox.bentobox.database.objects.Players;
|
||||||
import world.bentobox.bentobox.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class PlayersManagerTest {
|
|||||||
private World nether;
|
private World nether;
|
||||||
private World end;
|
private World end;
|
||||||
@Mock
|
@Mock
|
||||||
private BSBDatabase<Players> db;
|
private BBDatabase<Players> db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws java.lang.Exception
|
* @throws java.lang.Exception
|
||||||
|
@ -21,7 +21,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
Loading…
Reference in New Issue
Block a user