Skip to content

Commit

Permalink
Added a boolean to toggle santashovel command.
Browse files Browse the repository at this point in the history
  • Loading branch information
itzCrih committed Feb 17, 2024
1 parent c470a33 commit 7bc8033
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
5 changes: 1 addition & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>it.itzcrih</groupId>
<artifactId>CoralWinter</artifactId>
<version>1.3-SNAPSHOT</version>
<version>1.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>CoralWinter</name>
Expand Down Expand Up @@ -66,22 +66,19 @@
</repositories>

<dependencies>

<!-- Spigot Api -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- ProtocolLib -->
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.1.0</version>
<scope>provided</scope>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class SantaShovelCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (!CoralWinter.getConfigLoader().getConfig().getBoolean("santashovel.enable_command")) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', CoralWinter.getConfigLoader().getMessages().getString("errors.command_disabled")));
}
if (player.hasPermission("coralwinter.command.santashovel")) {
santaShovel.giveSantaShovel(player);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
Main-Class:

1 change: 1 addition & 0 deletions src/main/resources/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
errors:
config_loading: "There was an error while loading the config!"
no_perm: "&cSorry, but you don't have permission to use this command."
command_disabled: "&cThis command has been disabled from the configuration!"

commands:
reloaded_successfully: "&7The configuration has been &3reloaded &7successfully!"
Expand Down
14 changes: 10 additions & 4 deletions src/main/resources/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@

# Diamond shovel settings
santashovel:
# Please select an item for santashovel. (default: DIAMOND_SPADE)
type: DIAMOND_SPADE # Please insert a valid material (STONE_SPADE, GOLD_SPADE, DIAMOND_SPADE, WOOD_SPADE, IRON_SPADE)
# Should we give santashovel whenever a player joins?
give_on_join: true
display-name: "&c&lPala natalizia"
# Should we enable santashovel command?
enable_command: true
display-name: "&c&lChristmas shovel"
lore:
- "&7Feryzz sara' sicuramente contento"
- "&7se dai una ripulita a questa lobby!"
- "&7Damn, the whole lobby is full of snow."
- "&7I would definitely be happy if you clean it!"
- "&7 "
- "&7(Hold &bLeft-click &7to clean the snow)"

# Block protection settings
block_protection:
# If enabled you can only break and place blocks if you have permission
# If enabled you can only break and place blocks if you have the following permission:
# coralwinter.bypass.blockprotection
block_place_enabled: true
block_break_enabled: true

0 comments on commit 7bc8033

Please sign in to comment.