mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 13:45:14 +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.configuration.Config;
|
||||||
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
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.Notifier;
|
||||||
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.commands.BentoBoxCommand;
|
import world.bentobox.bentobox.commands.BentoBoxCommand;
|
||||||
import world.bentobox.bentobox.hooks.MultiverseCoreHook;
|
import world.bentobox.bentobox.hooks.MultiverseCoreHook;
|
||||||
import world.bentobox.bentobox.hooks.PlaceholderAPIHook;
|
import world.bentobox.bentobox.hooks.PlaceholderAPIHook;
|
||||||
@ -171,12 +173,9 @@ public class BentoBox extends JavaPlugin {
|
|||||||
isLoaded = true;
|
isLoaded = true;
|
||||||
Bukkit.getServer().getPluginManager().callEvent(new BentoBoxReadyEvent());
|
Bukkit.getServer().getPluginManager().callEvent(new BentoBoxReadyEvent());
|
||||||
|
|
||||||
instance.log("#############################################");
|
User.getInstance(Bukkit.getConsoleSender()).sendMessage("successfully-loaded",
|
||||||
instance.log(instance.getDescription().getFullName() + " has been fully enabled.");
|
TextVariables.VERSION, instance.getDescription().getVersion(),
|
||||||
instance.log("It took: " + (System.currentTimeMillis() - startMillis + "ms"));
|
"[time]", String.valueOf(System.currentTimeMillis() - startMillis));
|
||||||
instance.log("Thanks for using our plugin !");
|
|
||||||
instance.log("- Tastybento and Poslovitch, 2017-2019");
|
|
||||||
instance.log("#############################################");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,6 @@ public abstract class Addon {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes code when reloading the addon.
|
* Executes code when reloading the addon.
|
||||||
*
|
|
||||||
* @since 0.17.0 (Alpha 12)
|
|
||||||
*/
|
*/
|
||||||
public void onReload() {}
|
public void onReload() {}
|
||||||
|
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
package world.bentobox.bentobox.api.commands.admin.resets;
|
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.CompositeCommand;
|
||||||
|
import world.bentobox.bentobox.api.commands.ConfirmableCommand;
|
||||||
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 java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class AdminResetsResetCommand extends CompositeCommand {
|
public class AdminResetsResetCommand extends ConfirmableCommand {
|
||||||
|
|
||||||
public AdminResetsResetCommand(CompositeCommand parent) {
|
public AdminResetsResetCommand(CompositeCommand parent) {
|
||||||
super(parent, "reset");
|
super(parent, "reset");
|
||||||
@ -26,6 +29,18 @@ public class AdminResetsResetCommand extends CompositeCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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));
|
UUID target = getPlayers().getUUID(args.get(0));
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0));
|
user.sendMessage("general.errors.unknown-player", TextVariables.NAME, args.get(0));
|
||||||
@ -37,3 +52,4 @@ public class AdminResetsResetCommand extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -4,6 +4,5 @@ package world.bentobox.bentobox.api.events;
|
|||||||
* Fired when plugin 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
|
|
||||||
*/
|
*/
|
||||||
public class BentoBoxReadyEvent extends PremadeEvent {}
|
public class BentoBoxReadyEvent extends PremadeEvent {}
|
||||||
|
@ -7,7 +7,6 @@ import world.bentobox.bentobox.api.events.PremadeEvent;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Poslovitch
|
* @author Poslovitch
|
||||||
* @since 1.0
|
|
||||||
*/
|
*/
|
||||||
public class AddonBaseEvent extends PremadeEvent {
|
public class AddonBaseEvent extends PremadeEvent {
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ import world.bentobox.bentobox.api.events.PremadeEvent;
|
|||||||
* Fired when a team event happens.
|
* Fired when a team event happens.
|
||||||
*
|
*
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
* @since 1.0
|
|
||||||
*/
|
*/
|
||||||
public class CommandEvent extends PremadeEvent implements Cancellable {
|
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.
|
* Canceling this event will result in canceling the change.
|
||||||
*
|
*
|
||||||
* @author Poslovitch
|
* @author Poslovitch
|
||||||
* @since 1.0
|
|
||||||
*/
|
*/
|
||||||
public class FlagChangeEvent extends IslandBaseEvent {
|
public class FlagChangeEvent extends IslandBaseEvent {
|
||||||
private final UUID player;
|
private final UUID player;
|
||||||
|
@ -13,7 +13,6 @@ import world.bentobox.bentobox.lists.Flags;
|
|||||||
* Fired when an island event happens.
|
* Fired when an island event happens.
|
||||||
*
|
*
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
* @since 1.0
|
|
||||||
*/
|
*/
|
||||||
public class IslandEvent extends IslandBaseEvent {
|
public class IslandEvent extends IslandBaseEvent {
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import world.bentobox.bentobox.database.objects.Island;
|
|||||||
* Fired when a team event happens.
|
* Fired when a team event happens.
|
||||||
*
|
*
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
* @since 1.0
|
|
||||||
*/
|
*/
|
||||||
public class TeamEvent {
|
public class TeamEvent {
|
||||||
|
|
||||||
|
@ -805,3 +805,14 @@ language:
|
|||||||
panel-title: "Select your language"
|
panel-title: "Select your language"
|
||||||
selected: "&aCurrently selected."
|
selected: "&aCurrently selected."
|
||||||
edited: "&aChanged your language to &e[lang]&a."
|
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