mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-29 04:27:46 +01:00
Merge branch 'develop' of https://github.com/BentoBoxWorld/bentobox.git into develop
This commit is contained in:
commit
8452a080f7
@ -8,7 +8,9 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import world.bentobox.bentobox.api.configuration.Config;
|
||||
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||
import world.bentobox.bentobox.api.user.Notifier;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.commands.BentoBoxCommand;
|
||||
import world.bentobox.bentobox.hooks.MultiverseCoreHook;
|
||||
import world.bentobox.bentobox.hooks.PlaceholderAPIHook;
|
||||
@ -171,12 +173,9 @@ public class BentoBox extends JavaPlugin {
|
||||
isLoaded = true;
|
||||
Bukkit.getServer().getPluginManager().callEvent(new BentoBoxReadyEvent());
|
||||
|
||||
instance.log("#############################################");
|
||||
instance.log(instance.getDescription().getFullName() + " has been fully enabled.");
|
||||
instance.log("It took: " + (System.currentTimeMillis() - startMillis + "ms"));
|
||||
instance.log("Thanks for using our plugin !");
|
||||
instance.log("- Tastybento and Poslovitch, 2017-2019");
|
||||
instance.log("#############################################");
|
||||
User.getInstance(Bukkit.getConsoleSender()).sendMessage("successfully-loaded",
|
||||
TextVariables.VERSION, instance.getDescription().getVersion(),
|
||||
"[time]", String.valueOf(System.currentTimeMillis() - startMillis));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -61,8 +61,6 @@ public abstract class Addon {
|
||||
|
||||
/**
|
||||
* Executes code when reloading the addon.
|
||||
*
|
||||
* @since 0.17.0 (Alpha 12)
|
||||
*/
|
||||
public void onReload() {}
|
||||
|
||||
|
@ -1,13 +1,16 @@
|
||||
package world.bentobox.bentobox.api.commands.admin.resets;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.commands.ConfirmableCommand;
|
||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AdminResetsResetCommand extends CompositeCommand {
|
||||
public class AdminResetsResetCommand extends ConfirmableCommand {
|
||||
|
||||
public AdminResetsResetCommand(CompositeCommand parent) {
|
||||
super(parent, "reset");
|
||||
@ -26,14 +29,27 @@ public class AdminResetsResetCommand extends CompositeCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUID target = getPlayers().getUUID(args.get(0));
|
||||
if (target == null) {
|
||||
user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0));
|
||||
return false;
|
||||
} else {
|
||||
getPlayers().setResets(getWorld(), target, 0);
|
||||
user.sendMessage("general.success");
|
||||
// Check if this is @a - therefore, we're resetting everyone's resets :)
|
||||
if (args.get(0).equalsIgnoreCase("@a")) {
|
||||
this.askConfirmation(user, () -> {
|
||||
// Set the reset epoch to now
|
||||
getIWM().setResetEpoch(getWorld());
|
||||
// Reset all current players
|
||||
Bukkit.getOnlinePlayers().stream().map(Player::getUniqueId).filter(getPlayers()::isKnown).forEach(u -> getPlayers().setResets(getWorld(), u, 0));
|
||||
user.sendMessage("general.success");
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
// Then, it may be a player
|
||||
UUID target = getPlayers().getUUID(args.get(0));
|
||||
if (target == null) {
|
||||
user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0));
|
||||
return false;
|
||||
} else {
|
||||
getPlayers().setResets(getWorld(), target, 0);
|
||||
user.sendMessage("general.success");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,5 @@ package world.bentobox.bentobox.api.events;
|
||||
* Fired when plugin is ready to play and all files are loaded
|
||||
*
|
||||
* @author tastybento
|
||||
* @since 1.0
|
||||
*/
|
||||
public class BentoBoxReadyEvent extends PremadeEvent {}
|
||||
|
@ -7,7 +7,6 @@ import world.bentobox.bentobox.api.events.PremadeEvent;
|
||||
|
||||
/**
|
||||
* @author Poslovitch
|
||||
* @since 1.0
|
||||
*/
|
||||
public class AddonBaseEvent extends PremadeEvent {
|
||||
|
||||
|
@ -10,7 +10,6 @@ import world.bentobox.bentobox.api.events.PremadeEvent;
|
||||
* Fired when a team event happens.
|
||||
*
|
||||
* @author tastybento
|
||||
* @since 1.0
|
||||
*/
|
||||
public class CommandEvent extends PremadeEvent implements Cancellable {
|
||||
|
||||
|
@ -12,7 +12,6 @@ import world.bentobox.bentobox.database.objects.Island;
|
||||
* Canceling this event will result in canceling the change.
|
||||
*
|
||||
* @author Poslovitch
|
||||
* @since 1.0
|
||||
*/
|
||||
public class FlagChangeEvent extends IslandBaseEvent {
|
||||
private final UUID player;
|
||||
|
@ -13,7 +13,6 @@ import world.bentobox.bentobox.lists.Flags;
|
||||
* Fired when an island event happens.
|
||||
*
|
||||
* @author tastybento
|
||||
* @since 1.0
|
||||
*/
|
||||
public class IslandEvent extends IslandBaseEvent {
|
||||
|
||||
|
@ -11,7 +11,6 @@ import world.bentobox.bentobox.database.objects.Island;
|
||||
* Fired when a team event happens.
|
||||
*
|
||||
* @author tastybento
|
||||
* @since 1.0
|
||||
*/
|
||||
public class TeamEvent {
|
||||
|
||||
|
@ -805,3 +805,14 @@ language:
|
||||
panel-title: "Select your language"
|
||||
selected: "&aCurrently selected."
|
||||
edited: "&aChanged your language to &e[lang]&a."
|
||||
|
||||
successfully-loaded: |
|
||||
|
||||
&6 ____ _ ____
|
||||
&6 | _ \ | | | _ \ &7by &atastybento &7and &aPoslovitch
|
||||
&6 | |_) | ___ _ __ | |_ ___ | |_) | _____ __ &72017 - 2019
|
||||
&6 | _ < / _ \ '_ \| __/ _ \| _ < / _ \ \/ /
|
||||
&6 | |_) | __/ | | | || (_) | |_) | (_) > < &bv&e[version]
|
||||
&6 |____/ \___|_| |_|\__\___/|____/ \___/_/\_\ &8Loaded in &e[time]&8ms.
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user