sinkillerj / ProjectE

ProjectE. A complete rewrite of EE2 for modern Minecraft versions.
MIT License
406 stars 206 forks source link

How to set all less than 1 emc items to 1 #2355

Open boiii12345 opened 3 months ago

boiii12345 commented 3 months ago

Tickets that do not conform to this template will be closed without comment

ProjectE-1.18.2-PE1.0.1

Forge-40.2.21

I want to set all things with less than 1 emc(like glass pane)to 1. I realize this could cheese it but its a singleplayer world and I just want to. Anyway I was looking at the mod(listed at top) and (unzipped) atC:\Users\Charlie\Downloads\ProjectE-1.18.2-PE1.0.1\moze_intel\projecte\integration\crafttweaker\CrTCustomConversion.class it has the code.

public class CrTCustomEMC { private CrTCustomEMC() { }

@Method public static void setEMCValue(NormalizedSimpleStack stack, long emc) { if (emc < 0L) { throw new IllegalArgumentException("EMC cannot be set to a negative number. Was set to: " + emc); } else { CraftTweakerAPI.apply(new CustomEMCAction(stack, emc)); } }

@Method public static void removeEMCValue(NormalizedSimpleStack stack) { CraftTweakerAPI.apply(new CustomEMCAction(stack, 0L)); } }

it looks like if I knew how to code i could for if emc is less than zero set to 1 but i dont know how to do that. If this is not how to do it than you can correct me i dont really know what I am doing. Also if this is already solved if there is link to that, that would work cause i cant find it. Ps file posted is the .class file changed to .java by https://www.decompiler.com then changed by me to .txt CrTCustomEMC.txt