-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌟 Added reload command, Closes #40. Added buy/claim delay based on pe…
…rmission. Closes #41 Took 29 minutes
- Loading branch information
Showing
6 changed files
with
166 additions
and
5 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
74 changes: 74 additions & 0 deletions
74
src/main/java/ca/tweetzy/skulls/commands/ReloadCommand.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,74 @@ | ||
/* | ||
* Skulls | ||
* Copyright 2022 Kiran Hart | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package ca.tweetzy.skulls.commands; | ||
|
||
import ca.tweetzy.flight.command.AllowedExecutor; | ||
import ca.tweetzy.flight.command.Command; | ||
import ca.tweetzy.flight.command.ReturnType; | ||
import ca.tweetzy.flight.comp.enums.CompMaterial; | ||
import ca.tweetzy.flight.nbtapi.NBT; | ||
import ca.tweetzy.flight.settings.TranslationManager; | ||
import ca.tweetzy.flight.utils.Common; | ||
import ca.tweetzy.flight.utils.PlayerUtil; | ||
import ca.tweetzy.skulls.Skulls; | ||
import ca.tweetzy.skulls.api.interfaces.PlacedSkull; | ||
import ca.tweetzy.skulls.api.interfaces.Skull; | ||
import ca.tweetzy.skulls.settings.Settings; | ||
import ca.tweetzy.skulls.settings.Translations; | ||
import org.bukkit.block.Block; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import java.util.List; | ||
|
||
public final class ReloadCommand extends Command { | ||
|
||
public ReloadCommand() { | ||
super(AllowedExecutor.BOTH, "reload"); | ||
} | ||
|
||
@Override | ||
protected ReturnType execute(CommandSender sender, String... args) { | ||
Settings.setup(); | ||
Translations.init(); | ||
tell(sender, "&aReloaded configuration files"); | ||
return ReturnType.SUCCESS; | ||
} | ||
|
||
@Override | ||
protected List<String> tab(CommandSender sender, String... args) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getPermissionNode() { | ||
return Settings.GENERAL_USAGE_REQUIRES_NO_PERM.getBoolean() ? null : "skulls.command.reload"; | ||
} | ||
|
||
@Override | ||
public String getSyntax() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Used to reload the plugin"; | ||
} | ||
} |
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
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