Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condensers Ignore Covalence Loss #1982

Open
wants to merge 5 commits into
base: mc1.12.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/moze_intel/projecte/config/ProjectEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public static class Misc {
@Config.RangeInt(min = 0)
@Config.Comment("A cooldown (in ticks) for Gem Chestplate explosion")
public int gemChestCooldown = 0;

@Config.Comment("Set to true to make Energy Condensers ignore Covalence Loss")
public boolean condenserIgnoreCovalenceLoss = false;
}

@Config.Comment({"Cooldown for various items within the pedestal. A cooldown of -1 will disable the functionality.",
Expand Down
1 change: 1 addition & 0 deletions src/main/java/moze_intel/projecte/emc/EMCMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public final class EMCMapper

public static double covalenceLoss = ProjectEConfig.difficulty.covalenceLoss;
public static boolean covalenceLossRounding = ProjectEConfig.difficulty.covalenceLossRounding;
public static boolean condenserIgnoreCovalenceLoss = ProjectEConfig.misc.condenserIgnoreCovalenceLoss;

public static void map()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected void condense()
continue;
}

this.addEMC(EMCHelper.getEmcSellValue(stack) * stack.getCount());
this.addEMC(EMCHelper.getEmcSellValue(stack, true) * stack.getCount());
getInput().setStackInSlot(i, ItemStack.EMPTY);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected void condense()
}

inputInventory.extractItem(i, 1, false);
this.addEMC(EMCHelper.getEmcSellValue(stack));
this.addEMC(EMCHelper.getEmcSellValue(stack, true));
break;
}

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/moze_intel/projecte/utils/EMCHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ public static long getEmcSellValue(ItemStack stack)
return emc;
}

public static long getEmcSellValue(ItemStack stack, boolean isCondenser) {
if (!isCondenser || !EMCMapper.condenserIgnoreCovalenceLoss) return getEmcSellValue(stack);

return EMCHelper.getEmcValue(stack);
}

public static String getEmcSellString(ItemStack stack, int stackSize)
{
if (EMCMapper.covalenceLoss == 1.0)
Expand Down