Converted references of BSkyBlock to BentoBox

This commit is contained in:
tastybento 2018-07-29 17:09:48 -07:00
parent f2831c7258
commit c7ff1bbae4
26 changed files with 49 additions and 51 deletions

View File

@ -67,7 +67,7 @@ public class Metrics {
/** /**
* Class constructor. * Class constructor.
* *
* @param plugin - BSkyBlock plugin object The plugin which stats should be submitted. * @param plugin - plugin object The plugin which stats should be submitted.
*/ */
public Metrics(JavaPlugin plugin) { public Metrics(JavaPlugin plugin) {
if (plugin == null) { if (plugin == null) {

View File

@ -19,7 +19,7 @@ import world.bentobox.bbox.managers.IslandsManager;
import world.bentobox.bbox.managers.PlayersManager; import world.bentobox.bbox.managers.PlayersManager;
/** /**
* Add-on class for BSkyBlock. Extend this to create an add-on. The operation * Add-on class for BentoBox. Extend this to create an add-on. The operation
* and methods are very similar to Bukkit's JavaPlugin. * and methods are very similar to Bukkit's JavaPlugin.
* *
* @author tastybento, ComminQ_Q * @author tastybento, ComminQ_Q
@ -37,7 +37,7 @@ public abstract class Addon implements AddonInterface {
enabled = false; enabled = false;
} }
public BentoBox getBSkyBlock() { public BentoBox getPlugin() {
return BentoBox.getInstance(); return BentoBox.getInstance();
} }
@ -76,7 +76,7 @@ public abstract class Addon implements AddonInterface {
* @return Logger * @return Logger
*/ */
public Logger getLogger() { public Logger getLogger() {
return getBSkyBlock().getLogger(); return getPlugin().getLogger();
} }
/** /**
@ -85,7 +85,7 @@ public abstract class Addon implements AddonInterface {
* @return the server object * @return the server object
*/ */
public Server getServer() { public Server getServer() {
return getBSkyBlock().getServer(); return getPlugin().getServer();
} }
public boolean isEnabled() { public boolean isEnabled() {
@ -264,7 +264,7 @@ public abstract class Addon implements AddonInterface {
* @return Players manager * @return Players manager
*/ */
public PlayersManager getPlayers() { public PlayersManager getPlayers() {
return getBSkyBlock().getPlayers(); return getPlugin().getPlayers();
} }
/** /**
@ -272,7 +272,7 @@ public abstract class Addon implements AddonInterface {
* @return Islands manager * @return Islands manager
*/ */
public IslandsManager getIslands() { public IslandsManager getIslands() {
return getBSkyBlock().getIslands(); return getPlugin().getIslands();
} }
/** /**
@ -280,18 +280,18 @@ public abstract class Addon implements AddonInterface {
* @return Optional Addon * @return Optional Addon
*/ */
public Optional<Addon> getAddonByName(String name) { public Optional<Addon> getAddonByName(String name) {
return getBSkyBlock().getAddonsManager().getAddonByName(name); return getPlugin().getAddonsManager().getAddonByName(name);
} }
public void log(String string) { public void log(String string) {
getBSkyBlock().log(string); getPlugin().log(string);
} }
public void logWarning(String string) { public void logWarning(String string) {
getBSkyBlock().logWarning(string); getPlugin().logWarning(string);
} }
public void logError(String string) { public void logError(String string) {
getBSkyBlock().logError(string); getPlugin().logError(string);
} }
} }

View File

@ -18,7 +18,7 @@ public enum AddonState {
DISABLED, DISABLED,
/** /**
* The addon has not been loaded because it requires a different version of BSkyBlock or of the server software. * The addon has not been loaded because it requires a different version of BentoBox or of the server software.
*/ */
INCOMPATIBLE, INCOMPATIBLE,

View File

@ -6,11 +6,11 @@ import java.util.Optional;
import world.bentobox.bbox.api.user.User; import world.bentobox.bbox.api.user.User;
/** /**
* Interface for BSkyBlock Commands * Interface for BentoBox Commands
* @author tastybento * @author tastybento
* *
*/ */
public interface BSBCommand { public interface BentoBoxCommand {
/** /**
* Anything that needs to be set up for this command. * Anything that needs to be set up for this command.

View File

@ -37,7 +37,7 @@ import world.bentobox.bbox.util.Util;
* @author tastybento * @author tastybento
* @author Poslovitch * @author Poslovitch
*/ */
public abstract class CompositeCommand extends Command implements PluginIdentifiableCommand, BSBCommand { public abstract class CompositeCommand extends Command implements PluginIdentifiableCommand, BentoBoxCommand {
private final BentoBox plugin; private final BentoBox plugin;

View File

@ -15,7 +15,7 @@ import java.lang.annotation.Target;
public @interface StoreAt { public @interface StoreAt {
/** /**
* Path where this will be stored. If blank, it will be the BSkyBlock database folder. * Path where this will be stored. If blank, it will be the database folder.
*/ */
String path() default ""; String path() default "";

View File

@ -1,7 +1,7 @@
package world.bentobox.bbox.api.events; package world.bentobox.bbox.api.events;
/** /**
* Fired when BSkyBlock is ready to play and all files are loaded * Fired when plugin is ready to play and all files are loaded
* *
* @author tastybento * @author tastybento
* @since 1.0 * @since 1.0

View File

@ -35,7 +35,7 @@ public abstract class AbstractFlagListener implements Listener {
/** /**
* Used for unit testing only to set the plugin * Used for unit testing only to set the plugin
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public void setPlugin(BentoBox plugin) { public void setPlugin(BentoBox plugin) {
this.plugin = plugin; this.plugin = plugin;

View File

@ -18,14 +18,14 @@ public interface PlaceholderAPIInterface {
/** /**
* Registers the placeholder API * Registers the placeholder API
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
* @return true if successfully registered * @return true if successfully registered
*/ */
boolean register(BentoBox plugin); boolean register(BentoBox plugin);
/** /**
* Unregisters the placeholder API * Unregisters the placeholder API
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
void unregister(BentoBox plugin); void unregister(BentoBox plugin);

View File

@ -29,7 +29,7 @@ public class PlaceholderHandler {
/** /**
* Register placeholders and hooks * Register placeholders and hooks
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public static void register(BentoBox plugin){ public static void register(BentoBox plugin){
@ -64,7 +64,7 @@ public class PlaceholderHandler {
/** /**
* Unregister placeholder hooks * Unregister placeholder hooks
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public static void unregister(BentoBox plugin){ public static void unregister(BentoBox plugin){
Iterator<PlaceholderAPIInterface> it = apis.iterator(); Iterator<PlaceholderAPIInterface> it = apis.iterator();

View File

@ -114,7 +114,7 @@ public class User {
/** /**
* Used for testing * Used for testing
* @param p - BSkyBlock plugin * @param p - plugin
*/ */
public static void setPlugin(BentoBox p) { public static void setPlugin(BentoBox p) {
plugin = p; plugin = p;

View File

@ -31,7 +31,7 @@ public class IslandAboutCommand extends CompositeCommand {
user.sendRawMessage(" * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."); user.sendRawMessage(" * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.");
user.sendRawMessage(" * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."); user.sendRawMessage(" * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.");
user.sendRawMessage(" * Neither the name of the BSkyBlock Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."); user.sendRawMessage(" * Neither the name of the development team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.");
user.sendRawMessage("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" " user.sendRawMessage("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" "
+ "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " + "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE "

View File

@ -10,7 +10,7 @@ import world.bentobox.bbox.BentoBox;
import world.bentobox.bbox.api.addons.Addon; import world.bentobox.bbox.api.addons.Addon;
/** /**
* Handy class to store and load Java POJOs in the BSkyBlock Database * Handy class to store and load Java POJOs in the Database
* @author tastybento * @author tastybento
* *
* @param <T> * @param <T>

View File

@ -49,7 +49,7 @@ public class MongoDBDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
/** /**
* Handles the connection to the database and creation of the initial database schema (tables) for * Handles the connection to the database and creation of the initial database schema (tables) for
* the class that will be stored. * the class that will be stored.
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
* @param type - the type of class to be stored in the database. Must inherit DataObject * @param type - the type of class to be stored in the database. Must inherit DataObject
* @param dbConnecter - authentication details for the database * @param dbConnecter - authentication details for the database
*/ */

View File

@ -45,7 +45,7 @@ public class MySQLDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
/** /**
* Handles the connection to the database and creation of the initial database schema (tables) for * Handles the connection to the database and creation of the initial database schema (tables) for
* the class that will be stored. * the class that will be stored.
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
* @param type - the type of class to be stored in the database. Must inherit DataObject * @param type - the type of class to be stored in the database. Must inherit DataObject
* @param dbConnecter - authentication details for the database * @param dbConnecter - authentication details for the database
*/ */

View File

@ -44,7 +44,7 @@ public class Players implements DataObject {
public Players() {} public Players() {}
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
* @param uniqueId - unique ID * @param uniqueId - unique ID
* Constructor - initializes the state variables * Constructor - initializes the state variables
* *

View File

@ -19,7 +19,7 @@ public class JoinLeaveListener implements Listener {
private PlayersManager players; private PlayersManager players;
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public JoinLeaveListener(BentoBox plugin) { public JoinLeaveListener(BentoBox plugin) {
this.plugin = plugin; this.plugin = plugin;

View File

@ -33,7 +33,7 @@ public class FlyingMobEvents implements Listener {
private WeakHashMap<Entity, Island> mobSpawnInfo; private WeakHashMap<Entity, Island> mobSpawnInfo;
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public FlyingMobEvents(BentoBox plugin) { public FlyingMobEvents(BentoBox plugin) {
this.plugin = plugin; this.plugin = plugin;

View File

@ -122,7 +122,7 @@ public class AddonsManager {
addons.add(addon); addons.add(addon);
// Inform the console // Inform the console
plugin.log("Loaded BSkyBlock addon " + addon.getDescription().getName() + "..."); plugin.log("Loaded addon " + addon.getDescription().getName() + "...");
} catch (Exception e) { } catch (Exception e) {
plugin.log(e.getMessage()); plugin.log(e.getMessage());
} }

View File

@ -35,7 +35,7 @@ public class FlagsManager {
} }
/** /**
* Register a new flag with BSkyBlock * Register a new flag
* @param flag flag to be registered * @param flag flag to be registered
* @return true if successfully registered, false if not, e.g., because one with the same ID already exists * @return true if successfully registered, false if not, e.g., because one with the same ID already exists
*/ */

View File

@ -30,7 +30,7 @@ public class LocalesManager {
public LocalesManager(BentoBox plugin) { public LocalesManager(BentoBox plugin) {
this.plugin = plugin; this.plugin = plugin;
loadLocales("BSkyBlock"); // Default loadLocales("BentoBox"); // Default
} }
/** /**

View File

@ -32,7 +32,7 @@ public class PlayersManager {
* This is the one-stop-shop of player info * This is the one-stop-shop of player info
* If the player is not cached, then a request is made to Players to obtain it * If the player is not cached, then a request is made to Players to obtain it
* *
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public PlayersManager(BentoBox plugin){ public PlayersManager(BentoBox plugin){
this.plugin = plugin; this.plugin = plugin;

View File

@ -29,7 +29,7 @@ public class RanksManager {
private LinkedHashMap<String, Integer> ranks = new LinkedHashMap<>(); private LinkedHashMap<String, Integer> ranks = new LinkedHashMap<>();
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
*/ */
public RanksManager(BentoBox plugin) { public RanksManager(BentoBox plugin) {
super(); super();

View File

@ -18,7 +18,7 @@ public class DeleteIslandChunks {
/** /**
* Deletes the island * Deletes the island
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
* @param island - island to delete * @param island - island to delete
*/ */
public DeleteIslandChunks(final BentoBox plugin, final Island island) { public DeleteIslandChunks(final BentoBox plugin, final Island island) {

View File

@ -48,7 +48,7 @@ public class SafeSpotTeleport {
/** /**
* Teleports and entity to a safe spot on island * Teleports and entity to a safe spot on island
* @param plugin - BSkyBlock plugin object * @param plugin - plugin object
* @param entity - entity to teleport * @param entity - entity to teleport
* @param location - the location * @param location - the location
* @param failureMessage - already translated failure message * @param failureMessage - already translated failure message

View File

@ -31,8 +31,6 @@ import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox; import org.powermock.reflect.Whitebox;
import world.bentobox.bbox.BentoBox; import world.bentobox.bbox.BentoBox;
import world.bentobox.bbox.api.addons.Addon;
import world.bentobox.bbox.api.addons.AddonDescription;
import world.bentobox.bbox.managers.AddonsManager; import world.bentobox.bbox.managers.AddonsManager;
import world.bentobox.bbox.managers.IslandsManager; import world.bentobox.bbox.managers.IslandsManager;
import world.bentobox.bbox.managers.PlayersManager; import world.bentobox.bbox.managers.PlayersManager;
@ -94,9 +92,9 @@ public class AddonTest {
} }
@Test @Test
public void testGetBSkyBlock() { public void testGetPlugin() {
TestClass test = new TestClass(); TestClass test = new TestClass();
assertEquals(plugin, test.getBSkyBlock()); assertEquals(plugin, test.getPlugin());
} }
@Test @Test