Skip to content

Commit

Permalink
Add support for projectiles to break spleef layers (Closes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Sep 28, 2024
1 parent 952843a commit 3172fc2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

public class SpleefConfig {

@ArenaOption(name = "projectiles-break-blocks", description = "Whether snowballs should break blocks.")
private boolean projectilesBreakBlocks = false;

@ArenaOption(name = "shovels", description = "The shovels for this spleef game.", required = true)
private Map<String, ItemStack> shovels;

public boolean shouldProjectilesBreakBlocks() {
return this.projectilesBreakBlocks;
}

@Nullable
public ItemStack getShovel(String name) {
return this.shovels == null ? null : this.shovels.get(name).clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class SpleefEventResolvers {
return null;
}

if (!egg.hasMetadata("splegg")) {
if (!egg.hasMetadata("splegg") && !ArenaSpleef.getInstance().getMainConfig().shouldProjectilesBreakBlocks()) {
return null;
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
# -----------------
config-version: 2.0 # The config version, do not change!

# Whether projectiles (i.e. snowballs) should break blocks or not.
projectiles-break-blocks: false

# The shovels to use for Spleef.
shovels:
classic: diamond_shovel{display-name=<yellow>Spleef Shovel}
super-shovel: golden_shovel{display-name=<aqua><bold>Super Spleef Shovel;enchantments=[unbreaking:10,efficiency:5]}
egg-cannon: netherite_shovel{display-name=<gold><bold>Egg Cannon;enchantments=[unbreaking:10,efficiency:5];item-flags=[hide_enchants]}
bow: bow{display-name=<red><bold>Fire Bow;enchantments=[unbreaking:10,infinity:1,flame:1]}
bow: bow{display-name=<red><bold>Fire Bow;enchantments=[unbreaking:10,infinity:1,flame:1]}

0 comments on commit 3172fc2

Please sign in to comment.