Adds more unfinished code for parsing and tab-completing advanced cost
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

This commit is contained in:
2025-02-03 19:34:57 +01:00
parent 42ca42c571
commit ad5066af4b
4 changed files with 333 additions and 17 deletions

View File

@@ -28,6 +28,46 @@ import java.util.Set;
public record ActionCost(double monetaryCost, int expCost, @Nullable ItemStack itemCost,
@NotNull Set<String> requiredPermissions) implements ConfigurationSerializable {
/**
* Changes the monetary cost of this action
*
* @param monetaryCost <p>The new monetary cost</p>
* @return <p>The resulting action cost</p>
*/
public ActionCost changeMonetaryCost(double monetaryCost) {
return new ActionCost(monetaryCost, this.expCost, this.itemCost, this.requiredPermissions);
}
/**
* Changes the experience cost of this action
*
* @param expCost <p>The new experience cost</p>
* @return <p>The resulting action cost</p>
*/
public ActionCost changeExpCost(int expCost) {
return new ActionCost(this.monetaryCost, expCost, this.itemCost, this.requiredPermissions);
}
/**
* Changes the item cost of this action
*
* @param itemCost <p>The new item cost</p>
* @return <p>The resulting action cost</p>
*/
public ActionCost changeItemCost(@Nullable ItemStack itemCost) {
return new ActionCost(this.monetaryCost, this.expCost, itemCost, this.requiredPermissions);
}
/**
* Changes the permission cost of this action
*
* @param requiredPermissions <p>The new permission cost</p>
* @return <p>The resulting action cost</p>
*/
public ActionCost changePermissionCost(@NotNull Set<String> requiredPermissions) {
return new ActionCost(this.monetaryCost, this.expCost, this.itemCost, requiredPermissions);
}
@NotNull
public String displayCost() {
StringBuilder builder = new StringBuilder();