Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Dec 14, 2024
1 parent d137c94 commit b22c171
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG/1.18/current.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
- `[NEW]` Recipe calculation depth is now configurable
- `[NEW]` Costs and multipliers are now configurable
- `[FIX]` Cost values fixed for some tags
- `[FIX]` Some tag values fixed
- `[DEV]` Removed some unneeded code
5 changes: 0 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ curseforge {
changelogType = 'markdown'
releaseType = findProperty("curseforge_release_type") ?: 'beta'
addGameVersion project.target_mc_version
// for (String v : project.additional_mc_versions.split(',')) {
// if (v) {
// addGameVersion v
// }
// }
relations {
optionalDependency 'configured'
requiredDependency 'jei'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ public static void init() {
ClientRegistry.registerKeyBinding(POPULATE_SHOPPING_LIST_MAPPING);
ClientRegistry.registerKeyBinding(CLEAR_SHOPPING_LIST_MAPPING);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public static void trigger(ModAdvancements.Key advancement, ServerPlayer player)
if(ModTriggers.ENTRIES.get(ct.getCriterion().getPath()) instanceof SimpleTrigger trigger) {
trigger.trigger(player);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@

import com.sweetrpg.crafttracker.CraftTracker;
import com.sweetrpg.crafttracker.common.config.ConfigHandler;
import com.sweetrpg.crafttracker.common.lib.Constants;
import com.sweetrpg.crafttracker.common.util.DebugUtil;
import com.sweetrpg.crafttracker.common.util.RecipeUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import org.apache.commons.lang3.ObjectUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
* Calculates the cost of an ingredient
* <p/>
Expand Down Expand Up @@ -79,7 +71,7 @@ public int calculate() {
CraftTracker.LOGGER.debug("multiplier: {}", multiplier);

if(multiplier != null) {
var newCost =(int) (cost * multiplier.get());
var newCost = (int) (cost * multiplier.get());
CraftTracker.LOGGER.debug("#calculate: increasing cost of tag {} in namespace {} by {}: from {} to {}",
tagId, tagNamespace, multiplier.get(),
cost, newCost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.sweetrpg.crafttracker.CraftTracker;
import com.sweetrpg.crafttracker.common.config.ConfigHandler;
import com.sweetrpg.crafttracker.common.util.DebugUtil;
import com.sweetrpg.crafttracker.common.util.RecipeUtil;
import com.sweetrpg.crafttracker.common.util.Util;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
Expand Down Expand Up @@ -66,7 +64,7 @@ public int calculate() {
CraftTracker.LOGGER.debug("multiplier: {}", multiplier);

if(multiplier != null) {
var newCost =(int) (cost * multiplier.get());
var newCost = (int) (cost * multiplier.get());
CraftTracker.LOGGER.debug("#calculate: increasing cost of tag {} in namespace {} by {}: from {} to {}",
tagId, tagNamespace, multiplier.get(),
cost, newCost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.sweetrpg.crafttracker.common.config.ConfigHandler;
import com.sweetrpg.crafttracker.common.util.DebugUtil;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Recipe;
import org.apache.commons.lang3.ObjectUtils;

Expand Down Expand Up @@ -51,7 +50,7 @@ public int calculate() {
CraftTracker.LOGGER.debug("multiplier: {}", multiplier);

if(multiplier != null) {
var newCost =(int) (cost * multiplier.get());
var newCost = (int) (cost * multiplier.get());
CraftTracker.LOGGER.debug("#calculate: increasing cost of recipe {} in namespace {} by {}: from {} to {}",
recipe.getId(), recipeNamespace, multiplier.get(),
cost, newCost);
Expand All @@ -63,7 +62,7 @@ public int calculate() {

var typeMultiplier = ConfigHandler.COMMON.recipeTypeEntries.get(recipeType.toString());
if(typeMultiplier != null) {
var newCost =(int) (cost * typeMultiplier.get());
var newCost = (int) (cost * typeMultiplier.get());
CraftTracker.LOGGER.debug("#calculate: increasing cost of recipe type {} by {}: from {} to {}",
recipeType, typeMultiplier.get(),
cost, newCost);
Expand Down

0 comments on commit b22c171

Please sign in to comment.