Skip to content

Commit

Permalink
feat(jei): 🧻now ingredients in various HEI hints show soul and egg
Browse files Browse the repository at this point in the history
Was only soul before
  • Loading branch information
Krutoy242 committed Jun 11, 2024
1 parent 8e7be31 commit 9443ba7
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 107 deletions.
103 changes: 52 additions & 51 deletions scripts/do/anvil_fall.zs
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
#modloaded requious
#reloadable

static entityMap as int[string] = {
wolf : 0,
chicken : 1,
// cow : 2, // Cow cant be crafted if Cooking For Blockheads installed. Event just dont happens
creeper : 3,
skeleton : 4,
zombie_pigman : 5,
bat : 6,
zombie : 7,
witch : 8,
villager : 9,
ocelot : 10,
sheep : 11,
blaze : 12,
silverfish : 13,
spider : 14,
cave_spider : 15,
slime : 16,
ghast : 17,
enderman : 18,
magma_cube : 19,
squid : 20,
mooshroom : 21,
villager_golem : 22,
snowman : 23,
pig : 24,
endermite : 25,
guardian : 26,
rabbit : 27,
polar_bear : 28,
shulker : 29,
horse : 30,
skeleton_horse : 31,
zombie_horse : 32,
donkey : 33,
mule : 34,
llama : 35,
elder_guardian : 36,
wither_skeleton : 37,
stray : 38,
husk : 39,
zombie_villager : 40,
evocation_illager : 41,
vex : 42,
vindication_illager: 43,
} as int[string];
import crafttweaker.entity.IEntityDefinition;

static entityMap as int[IEntityDefinition] = {
<entity:minecraft:wolf> : 0,
<entity:minecraft:chicken> : 1,
// cow : 2, // Cow cant be crafted if Cooking For Blockheads installed. Event just dont happens
<entity:minecraft:creeper> : 3,
<entity:minecraft:skeleton> : 4,
<entity:minecraft:zombie_pigman> : 5,
<entity:minecraft:bat> : 6,
<entity:minecraft:zombie> : 7,
<entity:minecraft:witch> : 8,
<entity:minecraft:villager> : 9,
<entity:minecraft:ocelot> : 10,
<entity:minecraft:sheep> : 11,
<entity:minecraft:blaze> : 12,
<entity:minecraft:silverfish> : 13,
<entity:minecraft:spider> : 14,
<entity:minecraft:cave_spider> : 15,
<entity:minecraft:slime> : 16,
<entity:minecraft:ghast> : 17,
<entity:minecraft:enderman> : 18,
<entity:minecraft:magma_cube> : 19,
<entity:minecraft:squid> : 20,
<entity:minecraft:mooshroom> : 21,
<entity:minecraft:villager_golem> : 22,
<entity:minecraft:snowman> : 23,
<entity:minecraft:pig> : 24,
<entity:minecraft:endermite> : 25,
<entity:minecraft:guardian> : 26,
<entity:minecraft:rabbit> : 27,
<entity:minecraft:polar_bear> : 28,
<entity:minecraft:shulker> : 29,
<entity:minecraft:horse> : 30,
<entity:minecraft:skeleton_horse> : 31,
<entity:minecraft:zombie_horse> : 32,
<entity:minecraft:donkey> : 33,
<entity:minecraft:mule> : 34,
<entity:minecraft:llama> : 35,
<entity:minecraft:elder_guardian> : 36,
<entity:minecraft:wither_skeleton> : 37,
<entity:minecraft:stray> : 38,
<entity:minecraft:husk> : 39,
<entity:minecraft:zombie_villager> : 40,
<entity:minecraft:evocation_illager> : 41,
<entity:minecraft:vex> : 42,
<entity:minecraft:vindication_illager>: 43,
} as int[IEntityDefinition]$orderly;

// This function should be called once
// warding `/ct reload`
function postInit() as void {
for entity_id, num in entityMap {
val id = 'minecraft:' ~ entity_id;
for entityDef, num in entityMap {
scripts.jei.crafting_hints.addInsOutCatl(
[Soul(id), null, null, <minecraft:anvil>, <advancedrocketry:basalt>],
<openblocks:trophy:2>.withTag({ entity_id: id })
[entityDef.asIngr(), null, null, <minecraft:anvil>, <advancedrocketry:basalt>],
<openblocks:trophy:2>.withTag({ entity_id: entityDef.id })
);
}
}
Expand All @@ -77,7 +78,7 @@ events.onEntityLivingDamage(function (e as crafttweaker.event.EntityLivingDamage
val blockState = mob.world.getBlockState(blockUnderPos);
if (isNull(blockState) || blockState != <blockstate:advancedrocketry:basalt>) return;

val trophyIndex = entityMap[mob.definition.id.substring(10)];
val trophyIndex = entityMap[mob.definition];
if (isNull(trophyIndex)) return;

mob.world.removeEntity(mob);
Expand Down
2 changes: 1 addition & 1 deletion scripts/do/entity_kill_entity.zs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function add(deadEntity as string, killerEntity as string, item as IItemStack) a
by_drop[killerEntity] = item;
dropList[deadEntity] = by_drop;

scripts.jei.entity_kill_entity.add(Soul(killerEntity), Soul(deadEntity), item);
scripts.jei.entity_kill_entity.add(<entity:${killerEntity}>.asIngr(), <entity:${deadEntity}>.asIngr(), item);
}

events.onEntityLivingDeathDrops(function (e as crafttweaker.event.EntityLivingDeathDropsEvent) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/do/nether_travel_transform.zs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ val netherPortalEntityConversion = {

// Add JEI entries
for entityItem, entityDef in netherPortalEntityConversion {
scripts.jei.crafting_hints.addInsOutCatl([<forestry:butterfly_ge:*>], Soul(entityDef.id), <minecraft:obsidian>);
scripts.jei.crafting_hints.addInsOutCatl([<forestry:butterfly_ge:*>], entityDef.asStack(), <minecraft:obsidian>);
}

// Copy entity IDs to this list
Expand Down
6 changes: 3 additions & 3 deletions scripts/jei/crafting_hints.zs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ function special(output as IItemStack, input2d as IIngredient[][], condition as
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------

add1to1(<thaumcraft:cluster:1>, <minecraft:gold_ingot> * 8, Soul('randomthings:goldenchicken'));
add1to1(Soul('minecraft:zombie') | Soul('minecraft:villager'), <bloodmagic:blood_shard>, <bloodmagic:bound_sword>.withTag({ Unbreakable: 1 as byte, activated: 1 as byte }));
add1to1(<thaumcraft:cluster:1>, <minecraft:gold_ingot> * 8, <entity:randomthings:goldenchicken>.asIngr());
add1to1(<entity:minecraft:zombie>.asIngr() | <entity:minecraft:villager>.asIngr(), <bloodmagic:blood_shard>, <bloodmagic:bound_sword>.withTag({ Unbreakable: 1 as byte, activated: 1 as byte }));

x.addJEIRecipe(AssemblyRecipe.create(function (c) {
c.addFluidOutput('fluid_out', <liquid:canolaoil> * 80);
Expand Down Expand Up @@ -162,4 +162,4 @@ addInsOutCatl([<ic2:fluid_cell>.withTag({ Fluid: { FluidName: 'water', Amount: 1
scripts.jei.requious.add(<assembly:crafting_hints>, { [
<exnihilocreatio:block_barrel0> | <exnihilocreatio:block_barrel1>, null, null, null, null,
Bucket('milk'), <minecraft:brown_mushroom> | <minecraft:red_mushroom>,
]: [Soul('minecraft:slime'), <minecraft:slime>] });
]: [<entity:minecraft:slime>.asStack(), <minecraft:slime>] });
6 changes: 2 additions & 4 deletions scripts/jei/entity_drop.zs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import mods.requious.SlotVisual;
// -----------------------------------------------------------------------
var x = <assembly:entity_drop>;
x.addJEICatalyst(<minecraft:wooden_sword>);
scripts.jei.requious.addInsOuts(x, [[0,0],[0,1]], [
scripts.jei.requious.addInsOuts(x, [[0,0]], [
[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],
[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1],
]);
Expand All @@ -32,9 +32,7 @@ function add(entity as IEntityDefinition, dropList as IItemStack[], percent as b
} else {
fixedList = dropList;
}
scripts.jei.requious.add(<assembly:entity_drop>, {[
Soul(entity.id), <minecraft:spawn_egg>.withTag({EntityTag: {id: entity.id}})
] as IIngredient[] : fixedList});
scripts.jei.requious.add(<assembly:entity_drop>, {[entity.asIngr()] as IIngredient[] : fixedList});
}

/*Inject_js{
Expand Down
2 changes: 1 addition & 1 deletion scripts/jei/liquids.zs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interact(<fluid:cryotheum>, <fluid:water>, null, <minecraft:ice>);
interact(<fluid:cryotheum>, <fluid:water>, null, <minecraft:snow>);
interact(<fluid:cryotheum>, <fluid:lava>, null, <minecraft:obsidian>);
interact(<fluid:cryotheum>, <fluid:lava>, null, <minecraft:stone>);
interact(<fluid:cryotheum>, null, Soul('minecraft:creeper') | Soul('minecraft:zombie'), Soul('minecraft:snowman'));
interact(<fluid:cryotheum>, null, <entity:minecraft:creeper>.asIngr() | <entity:minecraft:zombie>.asIngr(), <entity:minecraft:snowman>.asStack());

interact(<fluid:petrotheum>, null, <minecraft:stone:*>, <minecraft:gravel>);
interact(<fluid:petrotheum>, null, <minecraft:cobblestone:*>, <minecraft:gravel>);
Expand Down
2 changes: 1 addition & 1 deletion scripts/jei/mod/bibliocraft.zs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for name, book in scripts.mods.bibliocraft_books.bookWrittenBy {
<minecraft:name_tag:*>,
<minecraft:paper>,
<bibliocraft:typewriter:*>,
Soul(scripts.mods.bibliocraft_books.bookWriters[name]),
<entity:${scripts.mods.bibliocraft_books.bookWriters[name]}>.asIngr(),
<bibliocraft:desk:*>,
<bibliocraft:seat:*>,
]: [book] });
Expand Down
48 changes: 24 additions & 24 deletions scripts/jei/mod/exnihilocreatio.zs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ x.addJEICatalyst(Bucket('witchwater'));
x.addJEICatalyst(<exnihilocreatio:witchwater>);
x.setJEIDurationSlot(1, 0, 'duration', scripts.jei.requious.getVisGauge(1, 8));
scripts.jei.requious.addInsOuts(x, [[0, 0]], [[2, 0]]);
addRecipe(x, { [Soul('minecraft:skeleton')]: [Soul('minecraft:wither_skeleton')] });
addRecipe(x, { [Soul('minecraft:creeper')]: [Soul('minecraft:creeper')] });
addRecipe(x, { [Soul('minecraft:slime')]: [Soul('minecraft:magma_cube')] });
addRecipe(x, { [Soul('minecraft:spider')]: [Soul('minecraft:cave_spider')] });
addRecipe(x, { [Soul('minecraft:squid')]: [Soul('minecraft:ghast')] });
addRecipe(x, { [Soul('minecraft:villager')]: [Soul('minecraft:zombie_villager')] });
addRecipe(x, { [Soul('minecraft:villager')]: [Soul('minecraft:witch')] });
addRecipe(x, { [Soul('minecraft:villager')]: [Soul('minecraft:evocation_illager')] });
addRecipe(x, { [Soul('minecraft:villager')]: [Soul('minecraft:vindication_illager')] });
addRecipe(x, { [Soul('minecraft:pig')]: [Soul('minecraft:zombie_pigman')] });
addRecipe(x, { [Soul('minecraft:cow')]: [Soul('minecraft:mooshroom')] });
addRecipe(x, { [<entity:minecraft:skeleton>.asIngr()]: [<entity:minecraft:wither_skeleton>.asStack()] });
addRecipe(x, { [<entity:minecraft:creeper>.asIngr()]: [<entity:minecraft:creeper>.asStack()] });
addRecipe(x, { [<entity:minecraft:slime>.asIngr()]: [<entity:minecraft:magma_cube>.asStack()] });
addRecipe(x, { [<entity:minecraft:spider>.asIngr()]: [<entity:minecraft:cave_spider>.asStack()] });
addRecipe(x, { [<entity:minecraft:squid>.asIngr()]: [<entity:minecraft:ghast>.asStack()] });
addRecipe(x, { [<entity:minecraft:villager>.asIngr()]: [<entity:minecraft:zombie_villager>.asStack()] });
addRecipe(x, { [<entity:minecraft:villager>.asIngr()]: [<entity:minecraft:witch>.asStack()] });
addRecipe(x, { [<entity:minecraft:villager>.asIngr()]: [<entity:minecraft:evocation_illager>.asStack()] });
addRecipe(x, { [<entity:minecraft:villager>.asIngr()]: [<entity:minecraft:vindication_illager>.asStack()] });
addRecipe(x, { [<entity:minecraft:pig>.asIngr()]: [<entity:minecraft:zombie_pigman>.asStack()] });
addRecipe(x, { [<entity:minecraft:cow>.asIngr()]: [<entity:minecraft:mooshroom>.asStack()] });
addRecipe(x, { [<openblocks:luggage>]: [<openblocks:luggage>.withTag({ size: 54 })] });

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -77,22 +77,22 @@ val SB = <exnihilocreatio:block_barrel1>;
const blacklist = loadJson("config/exnihilocreatio/BarrelLiquidBlacklistRegistry.json")[0]
return loadJson("config/exnihilocreatio/MilkEntityRegistry.json")
.map(o=>[
`add_barrel_milking(Soul('${o.entityOnTop}')`,
`add_barrel_milking(<entity:${o.entityOnTop}>.asIngr()`,
blacklist.includes(o.result) ? ', SB' : ', WB',
`, <liquid:${o.result}>`, ` * ${o.amount}`,
`, ${o.coolDown});`
])
} */
add_barrel_milking(Soul('minecraft:cow') , WB, <liquid:milk> * 10 , 20);
add_barrel_milking(Soul('emberroot:timberwolf') , WB, <liquid:tree_oil> * 10 , 20);
add_barrel_milking(Soul('emberroot:rainbow_golem') , SB, <liquid:construction_alloy> * 10 , 20);
add_barrel_milking(Soul('excompressum:angry_chicken') , SB, <liquid:fiery_essence> * 10 , 20);
add_barrel_milking(Soul('emberroot:skeleton_frozen') , WB, <liquid:ice> * 10 , 20);
add_barrel_milking(Soul('betteranimalsplus:walrus') , WB, <liquid:lubricant> * 10 , 20);
add_barrel_milking(Soul('mekanism:robit') , SB, <liquid:electronics> * 10 , 20);
add_barrel_milking(Soul('endreborn:watcher') , SB, <liquid:obsidian> * 40 , 20);
add_barrel_milking(Soul('betteranimalsplus:hirschgeist'), SB, <liquid:platinum> * 10 , 20);
add_barrel_milking(Soul('rats:neo_ratlantean') , SB, <liquid:crystal_matrix> * 1 , 20);
add_barrel_milking(Soul('iceandfire:if_cockatrice') , SB, <liquid:gelatin> * 10 , 20);
add_barrel_milking(Soul('openblocks:mini_me') , WB, <liquid:blockfluiddirt> * 100, 20);
add_barrel_milking(<entity:minecraft:cow>.asIngr() , WB, <liquid:milk> * 10 , 20);
add_barrel_milking(<entity:emberroot:timberwolf>.asIngr() , WB, <liquid:tree_oil> * 10 , 20);
add_barrel_milking(<entity:emberroot:rainbow_golem>.asIngr() , SB, <liquid:construction_alloy> * 10 , 20);
add_barrel_milking(<entity:excompressum:angry_chicken>.asIngr() , SB, <liquid:fiery_essence> * 10 , 20);
add_barrel_milking(<entity:emberroot:skeleton_frozen>.asIngr() , WB, <liquid:ice> * 10 , 20);
add_barrel_milking(<entity:betteranimalsplus:walrus>.asIngr() , WB, <liquid:lubricant> * 10 , 20);
add_barrel_milking(<entity:mekanism:robit>.asIngr() , SB, <liquid:electronics> * 10 , 20);
add_barrel_milking(<entity:endreborn:watcher>.asIngr() , SB, <liquid:obsidian> * 40 , 20);
add_barrel_milking(<entity:betteranimalsplus:hirschgeist>.asIngr(), SB, <liquid:platinum> * 10 , 20);
add_barrel_milking(<entity:rats:neo_ratlantean>.asIngr() , SB, <liquid:crystal_matrix> * 1 , 20);
add_barrel_milking(<entity:iceandfire:if_cockatrice>.asIngr() , SB, <liquid:gelatin> * 10 , 20);
add_barrel_milking(<entity:openblocks:mini_me>.asIngr() , WB, <liquid:blockfluiddirt> * 100, 20);
/**/
2 changes: 1 addition & 1 deletion scripts/jei/mod/thaumtweaks.zs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import mods.requious.AssemblyRecipe;
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
val x = <assembly:pech_trades>;
x.addJEICatalyst(Soul('thaumcraft:pech'));
x.addJEICatalyst(<entity:thaumcraft:pech>.asStack());
x.setJEIItemSlot(3, 0, 'input0');

// Diamonds
Expand Down
27 changes: 27 additions & 0 deletions scripts/lib/expansions.zs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#priority 5000
#ignoreBracketErrors

import crafttweaker.item.IIngredient;
import crafttweaker.item.IItemStack;
import crafttweaker.entity.IEntityDefinition;

$expand IEntityDefinition$asSoul() as IItemStack {
return <draconicevolution:mob_soul>.withTag({EntityName: this.id});
}

$expand IEntityDefinition$asEgg() as IItemStack {
return <minecraft:spawn_egg>.withTag({EntityTag: {id: this.id}});
}

$expand IEntityDefinition$asStack() as IItemStack {
val soul = this.asSoul();
if (isNull(soul)) return this.asEgg();
return soul;
}

$expand IEntityDefinition$asIngr() as IIngredient {
val soul = this.asSoul();
val egg = this.asEgg();
if (isNull(soul)) return egg;
return soul | egg;
}
2 changes: 1 addition & 1 deletion scripts/mods/betteranimalsplus.zs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ scripts.jei.crafting_hints.addInsOutCatl(
<betteranimalsplus:antler>,
<betteranimalsplus:venisonraw>,
],
Soul('betteranimalsplus:hirschgeist'),
<entity:betteranimalsplus:hirschgeist>.asStack(),
<betteranimalsplus:handoffate>
);
// --------------------------------
Expand Down
8 changes: 4 additions & 4 deletions scripts/mods/rats.zs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ events.onAllowDespawn(function (e as crafttweaker.event.EntityLivingSpawnEvent)

// ######################################################################
// HEI hints
scripts.jei.crafting_hints.addInsOutsCatl([Soul('minecraft:villager'), <rats:plague_doctorate>], [Soul('rats:plague_doctor')]);
scripts.jei.crafting_hints.addInsOutsCatl([Soul('rats:plague_doctor')], [Soul('rats:black_death')], <cyclicmagic:ender_lightning>);
scripts.jei.crafting_hints.addInsOutsCatl([], [Soul('rats:plague_cloud'), Soul('rats:plague_beast')], Soul('rats:black_death'));
scripts.jei.crafting_hints.addInsOutsCatl([Soul('rats:feral_ratlantean'), <rats:vial_of_sentience>], [Soul('rats:neo_ratlantean')]);
scripts.jei.crafting_hints.addInsOutsCatl([<entity:minecraft:villager>.asIngr(), <rats:plague_doctorate>], [<entity:rats:plague_doctor>.asStack()]);
scripts.jei.crafting_hints.addInsOutsCatl([<entity:rats:plague_doctor>.asIngr()], [<entity:rats:black_death>.asStack()], <cyclicmagic:ender_lightning>);
scripts.jei.crafting_hints.addInsOutsCatl([], [<entity:rats:plague_cloud>.asStack(), <entity:rats:plague_beast>.asStack()], <entity:rats:black_death>.asIngr());
scripts.jei.crafting_hints.addInsOutsCatl([<entity:rats:feral_ratlantean>.asIngr(), <rats:vial_of_sentience>], [<entity:rats:neo_ratlantean>.asStack()]);

// ######################################################################
//
Expand Down
6 changes: 3 additions & 3 deletions scripts/mods/thaumadditions.zs
Original file line number Diff line number Diff line change
Expand Up @@ -1731,13 +1731,13 @@ scripts.jei.crafting_hints.add1to1(<ore:listAllgrain>, <contenttweaker:grain_pil
scripts.jei.crafting_hints.add1to1(<ore:listAllveggie>, <contenttweaker:vegetable_pill>, <thaumadditions:mithminite_scythe>.withLore(['§2fabrico§r']));
scripts.jei.crafting_hints.add1to1(<ore:foodCheese>, <contenttweaker:dairy_pill>, <thaumadditions:mithminite_scythe>.withLore(['§2fabrico§r']));

scripts.jei.crafting_hints.add1to1(Soul('thaumcraft:golem'), null, <thaumadditions:mithminite_scythe>.withLore(['§7machina§r']));
scripts.jei.crafting_hints.add1to1(<entity:thaumcraft:golem>.asIngr(), null, <thaumadditions:mithminite_scythe>.withLore(['§7machina§r']));

scripts.jei.crafting_hints.add1to1(Soul('minecraft:zombie_villager'), Soul('minecraft:villager'), <thaumadditions:mithminite_scythe>.withLore(['§fhumanus§r']));
scripts.jei.crafting_hints.add1to1(<entity:minecraft:zombie_villager>.asIngr(), <entity:minecraft:villager>.asStack(), <thaumadditions:mithminite_scythe>.withLore(['§fhumanus§r']));

scripts.jei.crafting_hints.addInsOutCatl([<minecraft:arrow>, <minecraft:fire_charge>], null, <thaumadditions:mithminite_scythe>.withLore(['§2permutatio§r']));

scripts.jei.crafting_hints.add1to1(Soul('minecraft:cow') | Soul('minecraft:chicken') | Soul('minecraft:sheep') | Soul('minecraft:pig'), null, <thaumadditions:mithminite_scythe>.withLore(['§cvictus§r']));
scripts.jei.crafting_hints.add1to1(<entity:minecraft:cow>.asIngr() | <entity:minecraft:chicken>.asIngr() | <entity:minecraft:sheep>.asIngr() | <entity:minecraft:pig>.asIngr(), null, <thaumadditions:mithminite_scythe>.withLore(['§cvictus§r']));


// [Adaminite armor set]
Expand Down
Loading

0 comments on commit 9443ba7

Please sign in to comment.