ProjectE Integration - TCreopargh/CraftTweakerIntegration GitHub Wiki

Allows you to manage ProjectE's EMC values in CraftTweaker. This only works if you have ProjectE installed.

Importing class

import mods.ctintegration.projecte.EMCManager;

Methods

Method Description
static void mapEMC() ProjectE normally maps emc values when the server starts, which is way later than when CraftTweaker registers it's recipes. If you want to get the EMC value outside of an event, you will have to call this method first to force ProjectE to map the EMC values. Otherwise, you will get 0 EMC for every item. Make sure not to use this for a lot of times because mapping EMC takes a long time, especially on large modpacks.
static long getEMC(IItemStack item) Gets the EMC value for an item. If you want to use this outside of events you will have to call mapEMC first.
static long getEMCSellValue(IItemStack item) Gets the sell value for an item, depends on your ProjectE configuration. Also same as above, call mapEMC first.
static boolean isEMCSet(IItemStack item) Returns if an item's EMC value has been set
static void setEMC(IItemStack item, long value) Sets the EMC of an item. note: if you get the same item's EMC value after setting the value for it, you will still get the old value, unless you call mapEMC() again after setting the item's EMC and before getting it.
static void setEMC(IIngredient ingredient, long value) Sets EMC for all items in an IIngredient

IItemStack expansion

You can call these methods on an IItemStack instance.

Getter Return Type Setter Setter Parameters Description
emc long emc long
emcSellValue long - -

IPlayer expansion

You can call these methods on an IPlayer instance.

Getter Return Type Setter Setter Parameters Description
personalEMC long personalEMC long Manipulate the player's personal EMC value.

Examples

print("emc: " + <minecraft:gold_ingot>.emc); // Prints 0
<minecraft:gold_ingot>.emc = 6666;
print("emc: " + <minecraft:gold_ingot>.emc); // Prints 0, but the emc value will be set to 6666 if you join a world
EMCManager.mapEMC();
print("emc: " + <minecraft:gold_ingot>.emc); // Prints 2048, which is the default value for gold ingot
<minecraft:gold_ingot>.emc = 6666;
print("emc: " + <minecraft:gold_ingot>.emc); // Prints 2048, but the emc value will be set to 6666 if you join a world
EMCManager.mapEMC();
print("emc: " + <minecraft:gold_ingot>.emc); // Prints 2048, which is the default value for gold ingot
<minecraft:gold_ingot>.emc = 6666;
EMCManager.mapEMC(); // Note: this method takes a long time to run, don't call it for too many times
print("emc: " + <minecraft:gold_ingot>.emc); // Prints 6666