forked from lokka30/PhantomWorlds
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10/13 commands ported to new system.
- Loading branch information
1 parent
dd00781
commit ccca780
Showing
21 changed files
with
688 additions
and
775 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...in/java/me/lokka30/phantomworlds/commands/phantomworlds/parameters/sub/BackupCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package me.lokka30.phantomworlds.commands.phantomworlds.parameters.sub; | ||
|
||
/* | ||
* Phantom Worlds | ||
* Copyright (C) 2023 Daniel "creatorfromhell" Vidmar | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import me.lokka30.microlib.messaging.MultiMessage; | ||
import me.lokka30.phantomworlds.PhantomWorlds; | ||
import org.bukkit.World; | ||
import revxrsal.commands.bukkit.BukkitCommandActor; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* BackupCommand | ||
* | ||
* @author creatorfromhell | ||
* @since 2.0.5.0 | ||
*/ | ||
public class BackupCommand { | ||
|
||
public static void onCommand(final BukkitCommandActor actor, final World world) { | ||
|
||
if(!PhantomWorlds.worldManager().backupWorld(world.getName())) { | ||
(new MultiMessage( | ||
PhantomWorlds.instance().messages.getConfig() | ||
.getStringList("command.phantomworlds.subcommands.backup.failure"), Arrays.asList( | ||
new MultiMessage.Placeholder("prefix", | ||
PhantomWorlds.instance().messages.getConfig().getString("common.prefix", "&b&lPhantomWorlds: &7"), | ||
true), | ||
new MultiMessage.Placeholder("world", world.getName(), false) | ||
))).send(actor.getSender()); | ||
} | ||
|
||
(new MultiMessage( | ||
PhantomWorlds.instance().messages.getConfig() | ||
.getStringList("command.phantomworlds.subcommands.backup.success"), Arrays.asList( | ||
new MultiMessage.Placeholder("prefix", | ||
PhantomWorlds.instance().messages.getConfig().getString("common.prefix", "&b&lPhantomWorlds: &7"), | ||
true), | ||
new MultiMessage.Placeholder("world", world.getName(), false) | ||
))).send(actor.getSender()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.