Are the electric items from Magneticraft compatible too?
Hi, does anyone have an idea if the Magneticraft electric tools are supported? I noticed that Magneticraft in general is supported (mainly for machinery), but I was wondering if I can use Magneticraft electric tools (such as chainsaw) for craftings and make them discharge as much as you can do for IC2 electric items
Crafting with electric items You can use and discharge IC2 tools in crafting recipes. For example: val chainsaw = IC2:itemToolChainsaw.anyDamage();
recipes.addShapeless(minecraft:stick * 3, [ore:plankWood, chainsaw.onlyIC2ChargeAtLeast(100).transformIC2Discharge(100)]);
the Magneticraft chainsaw has these infos: Magneticraft:item.chainsaw:1.withTag({Charge: 500000})
the charge tag is not needed in this case, I guess...
if the answer is yes, the question is "how?" I've tryed some pattern but I still wasn't able to adapt it and make it work
they are compatible. the .withTag({NBT}) is for NBT Data, such as "Hold Shift for more Info." or "Charge: 500000", all you need to do is alter the current charge, and include the limiter for the Charge to ensure someone doesn't go crazy and charge it with 2 billion EU (because the IntMax should be a little over 2 billion. 7FFF FFFF converted from Hex to Dec in your Calc.exe (or respective Calculator App) (it's 2,147,483,647) should be approximately the max, give or take 1. if it's not, then the max is half of that because for whatever reason they used a Floating Int which means the value can wrap to negative, and I'm pretty sure you don't want people complaining that their Chainsaw has -1,000,000 EU in it.
If they do end up with an item like that, you should be able to also set a Minimum Charge somehow and just have them throw it into a Crafting Grid to fix it.
You want to transform the NBT Data, I came across the thread for this recently, let me do some searching.
Edit: Merged Posts:
they are stating here that you want to try something like
var magChainsaw = <Magneticraft:item.chainsaw>.anyDamage().onlyWithTag({Charge:});
recipes.addShapeless(minecraft:stick * 3, [ore:plankWood, magChainsaw.onlyIC2ChargeAtLeast(100).transformIC2Discharge(100)]);
this is an estimate, might need some tweaking, but it should be accurate enough to work...probably.
is that <Magneticraft:item.chainsaw:1> from the /mt hand command? you gotta use a Code Tag to display it correctly on GitHub.
GitHub Formatting Tips:
>> Here <<
P.S. how do you Charge the Chainsaw? is it EU? because that's IC2. I believe there's a way to modify RF Charge also.
Edited in my example.
Research Notes:
var chestplateMud = <BiomesOPlenty:chestplateMud:*>;
var camelPack = <enviromine:camelPack>;
# Works: armor + camel pack -> armor with camel pack NBT
recipes.addShapeless(
chestplateMud,
[chestplateMud.marked("armor"),camelPack.marked("pack")],
function(output, inputs, crafting) {
val packTag = inputs.pack.tag;
return inputs.armor.withTag(packTag);
}
);
recipes.addShapeless(
camelPack,
[chestplateMud.marked("armor").onlyDamaged().onlyWithTag({camelPath: "enviromine:camelPack"})],
function(output,inputs,crafting) {
var packTag = inputs.armor.tag;
var armorDamage = inputs.armor.damage;
var giveBackArmor = <BiomesOPlenty:chestplateMud>.withDamage(armorDamage);
inputs.armor.giveBack(giveBackArmor);
return <enviromine:camelPack>.withTag(packTag);
}
);
updateTag({camelPath: ""}); or updateTag({camelPath: []});
Crafting with electric items
You can use and discharge IC2 tools in crafting recipes. For example:
val chainsaw = IC2:itemToolChainsaw.anyDamage();
recipes.addShapeless(minecraft:stick * 3, [ore:plankWood, chainsaw.onlyIC2ChargeAtLeast(100).transformIC2Discharge(100)]);
Magneticraft:item.chainsaw:1.withTag({Charge: 500000})
var magChainsaw = <Magneticraft:item.chainsaw>.anyDamage().onlyWithTag({Charge:});
recipes.addShapeless(minecraft:stick * 3, [ore:plankWood, magChainsaw.onlyIC2ChargeAtLeast(100).transformIC2Discharge(100)]);