mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-02 22:47:43 +01:00
Converted references of BSkyBlock to BentoBox
This commit is contained in:
parent
f2831c7258
commit
c7ff1bbae4
@ -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) {
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
|
|
||||||
|
@ -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.
|
@ -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;
|
||||||
|
|
||||||
|
@ -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 "";
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
@ -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;
|
||||||
|
@ -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 "
|
||||||
|
@ -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>
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
*
|
*
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,9 +100,9 @@ public class LocalesManager {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
BentoBox.getInstance().logError("Could not load '" + language.getName() + "' : " + e.getMessage()
|
BentoBox.getInstance().logError("Could not load '" + language.getName() + "' : " + e.getMessage()
|
||||||
+ " with the following cause '" + e.getCause() + "'." +
|
+ " with the following cause '" + e.getCause() + "'." +
|
||||||
" The file has likely an invalid YML format or has been made unreadable during the process."
|
" The file has likely an invalid YML format or has been made unreadable during the process."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
|
@ -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) {
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user