mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-21 16:47:39 +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.
|
||||
*
|
||||
* @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) {
|
||||
if (plugin == null) {
|
||||
|
@ -19,7 +19,7 @@ import world.bentobox.bbox.managers.IslandsManager;
|
||||
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.
|
||||
*
|
||||
* @author tastybento, ComminQ_Q
|
||||
@ -37,7 +37,7 @@ public abstract class Addon implements AddonInterface {
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
public BentoBox getBSkyBlock() {
|
||||
public BentoBox getPlugin() {
|
||||
return BentoBox.getInstance();
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ public abstract class Addon implements AddonInterface {
|
||||
* @return Logger
|
||||
*/
|
||||
public Logger getLogger() {
|
||||
return getBSkyBlock().getLogger();
|
||||
return getPlugin().getLogger();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,7 +85,7 @@ public abstract class Addon implements AddonInterface {
|
||||
* @return the server object
|
||||
*/
|
||||
public Server getServer() {
|
||||
return getBSkyBlock().getServer();
|
||||
return getPlugin().getServer();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
@ -264,7 +264,7 @@ public abstract class Addon implements AddonInterface {
|
||||
* @return Players manager
|
||||
*/
|
||||
public PlayersManager getPlayers() {
|
||||
return getBSkyBlock().getPlayers();
|
||||
return getPlugin().getPlayers();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -272,7 +272,7 @@ public abstract class Addon implements AddonInterface {
|
||||
* @return Islands manager
|
||||
*/
|
||||
public IslandsManager getIslands() {
|
||||
return getBSkyBlock().getIslands();
|
||||
return getPlugin().getIslands();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -280,18 +280,18 @@ public abstract class Addon implements AddonInterface {
|
||||
* @return Optional Addon
|
||||
*/
|
||||
public Optional<Addon> getAddonByName(String name) {
|
||||
return getBSkyBlock().getAddonsManager().getAddonByName(name);
|
||||
return getPlugin().getAddonsManager().getAddonByName(name);
|
||||
}
|
||||
|
||||
public void log(String string) {
|
||||
getBSkyBlock().log(string);
|
||||
getPlugin().log(string);
|
||||
}
|
||||
|
||||
public void logWarning(String string) {
|
||||
getBSkyBlock().logWarning(string);
|
||||
getPlugin().logWarning(string);
|
||||
}
|
||||
|
||||
public void logError(String string) {
|
||||
getBSkyBlock().logError(string);
|
||||
getPlugin().logError(string);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public enum AddonState {
|
||||
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,
|
||||
|
||||
|
@ -6,11 +6,11 @@ import java.util.Optional;
|
||||
import world.bentobox.bbox.api.user.User;
|
||||
|
||||
/**
|
||||
* Interface for BSkyBlock Commands
|
||||
* Interface for BentoBox Commands
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
public interface BSBCommand {
|
||||
public interface BentoBoxCommand {
|
||||
|
||||
/**
|
||||
* Anything that needs to be set up for this command.
|
@ -37,7 +37,7 @@ import world.bentobox.bbox.util.Util;
|
||||
* @author tastybento
|
||||
* @author Poslovitch
|
||||
*/
|
||||
public abstract class CompositeCommand extends Command implements PluginIdentifiableCommand, BSBCommand {
|
||||
public abstract class CompositeCommand extends Command implements PluginIdentifiableCommand, BentoBoxCommand {
|
||||
|
||||
private final BentoBox plugin;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.lang.annotation.Target;
|
||||
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 "";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
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
|
||||
* @since 1.0
|
||||
|
@ -35,7 +35,7 @@ public abstract class AbstractFlagListener implements Listener {
|
||||
|
||||
/**
|
||||
* Used for unit testing only to set the plugin
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
public void setPlugin(BentoBox plugin) {
|
||||
this.plugin = plugin;
|
||||
|
@ -18,14 +18,14 @@ public interface PlaceholderAPIInterface {
|
||||
|
||||
/**
|
||||
* Registers the placeholder API
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
* @return true if successfully registered
|
||||
*/
|
||||
boolean register(BentoBox plugin);
|
||||
|
||||
/**
|
||||
* Unregisters the placeholder API
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
void unregister(BentoBox plugin);
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class PlaceholderHandler {
|
||||
|
||||
/**
|
||||
* Register placeholders and hooks
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
public static void register(BentoBox plugin){
|
||||
|
||||
@ -64,7 +64,7 @@ public class PlaceholderHandler {
|
||||
|
||||
/**
|
||||
* Unregister placeholder hooks
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
public static void unregister(BentoBox plugin){
|
||||
Iterator<PlaceholderAPIInterface> it = apis.iterator();
|
||||
|
@ -114,7 +114,7 @@ public class User {
|
||||
|
||||
/**
|
||||
* Used for testing
|
||||
* @param p - BSkyBlock plugin
|
||||
* @param p - plugin
|
||||
*/
|
||||
public static void setPlugin(BentoBox 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 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\" "
|
||||
+ "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;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @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
|
||||
* 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 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
|
||||
* 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 dbConnecter - authentication details for the database
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@ public class Players implements DataObject {
|
||||
public Players() {}
|
||||
|
||||
/**
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
* @param uniqueId - unique ID
|
||||
* Constructor - initializes the state variables
|
||||
*
|
||||
|
@ -19,7 +19,7 @@ public class JoinLeaveListener implements Listener {
|
||||
private PlayersManager players;
|
||||
|
||||
/**
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
public JoinLeaveListener(BentoBox plugin) {
|
||||
this.plugin = plugin;
|
||||
|
@ -33,7 +33,7 @@ public class FlyingMobEvents implements Listener {
|
||||
private WeakHashMap<Entity, Island> mobSpawnInfo;
|
||||
|
||||
/**
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
public FlyingMobEvents(BentoBox plugin) {
|
||||
this.plugin = plugin;
|
||||
@ -70,8 +70,8 @@ public class FlyingMobEvents implements Listener {
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onMobSpawn(CreatureSpawnEvent e) {
|
||||
// Only cover withers in the island world
|
||||
if (!plugin.getIWM().inWorld(e.getEntity().getLocation()) || !(e.getEntityType().equals(EntityType.WITHER)
|
||||
|| e.getEntityType().equals(EntityType.BLAZE)
|
||||
if (!plugin.getIWM().inWorld(e.getEntity().getLocation()) || !(e.getEntityType().equals(EntityType.WITHER)
|
||||
|| e.getEntityType().equals(EntityType.BLAZE)
|
||||
|| e.getEntityType().equals(EntityType.GHAST))) {
|
||||
return;
|
||||
}
|
||||
@ -109,8 +109,8 @@ public class FlyingMobEvents implements Listener {
|
||||
return false;
|
||||
}
|
||||
// The wither or wither skulls can both blow up
|
||||
if (e.getEntityType() == EntityType.WITHER
|
||||
&& mobSpawnInfo.containsKey(e.getEntity())
|
||||
if (e.getEntityType() == EntityType.WITHER
|
||||
&& mobSpawnInfo.containsKey(e.getEntity())
|
||||
&& !mobSpawnInfo.get(e.getEntity()).inIslandSpace(e.getEntity().getLocation())) {
|
||||
// Cancel the explosion
|
||||
e.setCancelled(true);
|
||||
|
@ -122,7 +122,7 @@ public class AddonsManager {
|
||||
addons.add(addon);
|
||||
|
||||
// Inform the console
|
||||
plugin.log("Loaded BSkyBlock addon " + addon.getDescription().getName() + "...");
|
||||
plugin.log("Loaded addon " + addon.getDescription().getName() + "...");
|
||||
} catch (Exception e) {
|
||||
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
|
||||
* @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) {
|
||||
this.plugin = plugin;
|
||||
loadLocales("BSkyBlock"); // Default
|
||||
loadLocales("BentoBox"); // Default
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,9 +100,9 @@ public class LocalesManager {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
BentoBox.getInstance().logError("Could not load '" + language.getName() + "' : " + e.getMessage()
|
||||
+ " with the following cause '" + e.getCause() + "'." +
|
||||
" The file has likely an invalid YML format or has been made unreadable during the process."
|
||||
);
|
||||
+ " with the following cause '" + e.getCause() + "'." +
|
||||
" 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
|
||||
* 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){
|
||||
this.plugin = plugin;
|
||||
|
@ -29,7 +29,7 @@ public class RanksManager {
|
||||
private LinkedHashMap<String, Integer> ranks = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
*/
|
||||
public RanksManager(BentoBox plugin) {
|
||||
super();
|
||||
@ -81,7 +81,7 @@ public class RanksManager {
|
||||
ranks = ranks.entrySet().stream()
|
||||
.sorted(Map.Entry.comparingByValue())
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
|
||||
Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,7 +128,7 @@ public class RanksManager {
|
||||
return x;
|
||||
}
|
||||
return OWNER_RANK;
|
||||
}).min().orElse(currentRank);
|
||||
}).min().orElse(currentRank);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,7 +142,7 @@ public class RanksManager {
|
||||
return x;
|
||||
}
|
||||
return VISITOR_RANK;
|
||||
}).max().orElse(currentRank);
|
||||
}).max().orElse(currentRank);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,7 @@ public class DeleteIslandChunks {
|
||||
|
||||
/**
|
||||
* Deletes the island
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
* @param island - island to delete
|
||||
*/
|
||||
public DeleteIslandChunks(final BentoBox plugin, final Island island) {
|
||||
|
@ -48,7 +48,7 @@ public class SafeSpotTeleport {
|
||||
|
||||
/**
|
||||
* Teleports and entity to a safe spot on island
|
||||
* @param plugin - BSkyBlock plugin object
|
||||
* @param plugin - plugin object
|
||||
* @param entity - entity to teleport
|
||||
* @param location - the location
|
||||
* @param failureMessage - already translated failure message
|
||||
|
@ -31,8 +31,6 @@ import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import org.powermock.reflect.Whitebox;
|
||||
|
||||
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.IslandsManager;
|
||||
import world.bentobox.bbox.managers.PlayersManager;
|
||||
@ -94,9 +92,9 @@ public class AddonTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetBSkyBlock() {
|
||||
public void testGetPlugin() {
|
||||
TestClass test = new TestClass();
|
||||
assertEquals(plugin, test.getBSkyBlock());
|
||||
assertEquals(plugin, test.getPlugin());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user