Skip to content

Commit 3a13d80

Browse files
add Bewitchment compat (#307)
* Start Bewitchment support (again) * update registries * import PotionEffect by default * add forge registry documentation * add entityentry to code converter * skip documenting methods already documented * update bewitchment * implement bewitchment compat * debug properties are false * sort properties container * run spotless * remove import for potioneffect from examples * add bewitchment to curseforge deps * use EnumHelper in RecipeBuilder enums * fix typo in comment --------- Co-authored-by: mcadventurecity <[email protected]>
1 parent 29ac71f commit 3a13d80

File tree

31 files changed

+1775
-14
lines changed

31 files changed

+1775
-14
lines changed

dependencies.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ final def mod_dependencies = [
4646
'armor-plus-237366:2952741' : [project.debug_armor_plus],
4747
'thedragonlib-248055:2580332' : [project.debug_armor_plus],
4848
'astralsorcery-sorcery-241721:3044416' : [project.debug_astral],
49-
'baubles-227083:2518667' : [project.debug_blood_arsenal, project.debug_astral, project.debug_botania, project.debug_botania_tweaks, project.debug_botanic_additions, project.debug_essentialcraft_4, project.debug_extra_botany, project.debug_thaum],
49+
'baubles-227083:2518667' : [project.debug_blood_arsenal, project.debug_astral, project.debug_bewitchment, project.debug_botania, project.debug_botania_tweaks, project.debug_botanic_additions, project.debug_essentialcraft_4, project.debug_extra_botany, project.debug_thaum],
5050
'the-aurorian-352137:4981736' : [project.debug_aurorian],
5151
'avaritia_1_10-261348:3143349' : [project.debug_avaritia],
5252
'atum-2-59621:3116599' : [project.debug_atum],
5353
'better-with-addons-268326:2899407' : [project.debug_better_with_addons],
5454
'bwm-core-294335:2624990' : [project.debug_better_with_addons, project.debug_better_with_mods],
5555
'bwm-suite-246760:3289033' : [project.debug_better_with_addons, project.debug_better_with_mods],
56+
'bewitchment-legacy-285439:6379256' : [project.debug_bewitchment],
5657
'blood-arsenal-228823:2904183' : [project.debug_blood_arsenal],
5758
'blood-magic-224791:2822288' : [project.debug_blood_arsenal, project.debug_blood_magic],
5859
'guide-api-228832:2645992' : [project.debug_blood_arsenal, project.debug_blood_magic, project.debug_woot],
@@ -107,7 +108,7 @@ final def mod_dependencies = [
107108
'pyrotech-306676:4956838' : [project.debug_pyrotech],
108109
'random-things-59816:2905241' : [project.debug_random_things],
109110
'mystical_world-282940:3460961' : [project.debug_roots],
110-
'patchouli-306770:3162874' : [project.debug_roots, project.debug_natures_aura, project.debug_prodigytech],
111+
'patchouli-306770:3162874' : [project.debug_bewitchment, project.debug_roots, project.debug_natures_aura, project.debug_prodigytech],
111112
'prodigytech-297414:2769520' : [project.debug_prodigytech],
112113
'roots-246183:3905074' : [project.debug_roots],
113114
'rustic-256141:3107974' : [project.debug_rustic],
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
2+
// Auto generated groovyscript example file
3+
// MODS_LOADED: bewitchment
4+
5+
log.info 'mod \'bewitchment\' detected, running script'
6+
7+
// Altar Upgrades:
8+
// Controls the valid upgrades placed atop the Witches' Altar, a multiblock that gain Magic Power from nearby plants and
9+
// logs based on their uniqueness. The upgrades modify the amount gained per second and the maximum Magic Power the Altar
10+
// can hold.
11+
12+
mods.bewitchment.altar_upgrade.remove(blockstate('bewitchment:goblet'))
13+
mods.bewitchment.altar_upgrade.remove(item('bewitchment:garnet'))
14+
mods.bewitchment.altar_upgrade.removeByType(com.bewitchment.api.registry.AltarUpgrade.Type.WAND)
15+
// mods.bewitchment.altar_upgrade.removeAll()
16+
17+
mods.bewitchment.altar_upgrade.recipeBuilder()
18+
.cup()
19+
.predicate(blockstate('minecraft:clay'))
20+
.gain(-10)
21+
.multiplier(500)
22+
.register()
23+
24+
mods.bewitchment.altar_upgrade.recipeBuilder()
25+
.pentacle()
26+
.predicate(item('minecraft:gold_ingot'))
27+
.gain(1000)
28+
.register()
29+
30+
mods.bewitchment.altar_upgrade.recipeBuilder()
31+
.sword()
32+
.predicate(blockstate('minecraft:gold_block'))
33+
.multiplier(50)
34+
.register()
35+
36+
mods.bewitchment.altar_upgrade.recipeBuilder()
37+
.wand()
38+
.predicate(item('minecraft:iron_ingot'))
39+
.multiplier(0.5)
40+
.register()
41+
42+
43+
// Athame Loot:
44+
// When killing a mob with the Athame in the main hand, drops a random amount between `0` and `stackSize + lootingLevel` of
45+
// each item that the entity passes the predicate of.
46+
47+
mods.bewitchment.athame_loot.removeByOutput(item('bewitchment:spectral_dust'))
48+
// mods.bewitchment.athame_loot.removeAll()
49+
50+
mods.bewitchment.athame_loot.add(entity('minecraft:pig'), item('minecraft:gold_ingot'))
51+
mods.bewitchment.athame_loot.add(entity('minecraft:cow'), item('minecraft:clay') * 5, item('minecraft:iron_sword'))
52+
53+
// Witches' Cauldron Brew:
54+
// After throwing a `bewitchment:mandrake_root` in the Witches' Cauldron while Magic Power is provided, all items thrown in
55+
// will add their potion effects when extracted via a `minecraft:glass_bottle`. Each fill of the Cauldron can create 3
56+
// bottles. An ingredient can also refund an itemstack.
57+
58+
mods.bewitchment.brew.removeByInput(item('bewitchment:dragons_blood_resin'))
59+
mods.bewitchment.brew.removeByOutput(item('minecraft:bowl'))
60+
mods.bewitchment.brew.removeByPotion(potion('minecraft:instant_health'))
61+
// mods.bewitchment.brew.removeAll()
62+
63+
mods.bewitchment.brew.recipeBuilder()
64+
.input(ore('netherStar'))
65+
.outputCheck(item('minecraft:nether_star'))
66+
.effect(new PotionEffect(potion('minecraft:strength'), 1800, 3))
67+
.output(item('bewitchment:catechu_brown'))
68+
.register()
69+
70+
mods.bewitchment.brew.recipeBuilder()
71+
.input(item('minecraft:gold_ingot'))
72+
.effect(new PotionEffect(potion('minecraft:instant_health'), 1, 3))
73+
.output(item('minecraft:clay'))
74+
.register()
75+
76+
mods.bewitchment.brew.recipeBuilder()
77+
.input(item('minecraft:deadbush'))
78+
.effect(new PotionEffect(potion('minecraft:resistance'), 1800, 3))
79+
.register()
80+
81+
82+
// Witches' Cauldron:
83+
// Converts up to 10 input ingredients into up to 3 output itemstacks in the Witches' Cauldron while Magic Power is
84+
// provided.
85+
86+
mods.bewitchment.cauldron.remove(resource('bewitchment:catechu_brown'))
87+
mods.bewitchment.cauldron.removeByInput(item('bewitchment:tongue_of_dog'))
88+
mods.bewitchment.cauldron.removeByOutput(item('bewitchment:iron_gall_ink'))
89+
// mods.bewitchment.cauldron.removeAll()
90+
91+
mods.bewitchment.cauldron.recipeBuilder()
92+
.input(ore('logWood'))
93+
.input(item('minecraft:deadbush'))
94+
.input(item('minecraft:dye', 3))
95+
.output(item('bewitchment:catechu_brown'))
96+
.register()
97+
98+
99+
// Curses:
100+
// Allows applying curses to a player to cause unique effects in the Brazier with a `bewitchment:taglock` targeting the
101+
// desired player.
102+
103+
mods.bewitchment.curse.remove(resource('bewitchment:berserker'))
104+
mods.bewitchment.curse.removeByInput(item('minecraft:blaze_rod'))
105+
// mods.bewitchment.curse.removeAll()
106+
107+
// Distillery:
108+
// Converts up to 6 input ingredients into up to 6 output itemstacks in the Distillery at the cost of 1 Magic Power per
109+
// tick. Takes 10 seconds.
110+
111+
mods.bewitchment.distillery.remove(resource('bewitchment:bottled_frostfire'))
112+
mods.bewitchment.distillery.removeByInput(item('bewitchment:perpetual_ice'))
113+
mods.bewitchment.distillery.removeByOutput(item('bewitchment:demonic_elixir'))
114+
// mods.bewitchment.distillery.removeAll()
115+
116+
mods.bewitchment.distillery.recipeBuilder()
117+
.input(item('minecraft:glass_bottle'))
118+
.input(item('minecraft:snow'))
119+
.input(item('bewitchment:cleansing_balm'))
120+
.input(item('bewitchment:fiery_unguent'))
121+
.output(item('bewitchment:bottled_frostfire'))
122+
.output(item('bewitchment:empty_jar') * 2)
123+
.register()
124+
125+
126+
// Fortune:
127+
// Modifies potential Fortunes, with a random one being selected from the list when interacting with a Crystal Ball. Some
128+
// amount of time will pass before the Fortune occurs, whereupon a customizable effect will happen.
129+
130+
mods.bewitchment.fortune.remove(resource('bewitchment:cornucopia'))
131+
// mods.bewitchment.fortune.removeAll()
132+
133+
// Frostfire:
134+
// Converts an input ingredient into an output itemstack once a second while inside a Frostfire block.
135+
136+
mods.bewitchment.frostfire.removeByInput(item('minecraft:iron_ore'))
137+
// mods.bewitchment.frostfire.removeByOutput(item('bewitchment:cold_iron_ingot'))
138+
// mods.bewitchment.frostfire.removeAll()
139+
140+
mods.bewitchment.frostfire.recipeBuilder()
141+
.input(item('minecraft:water_bucket'))
142+
.output(item('minecraft:ice'))
143+
.register()
144+
145+
146+
// Incense:
147+
// Converts up to 8 input ingredients in the Brazier when activated by a Flint and Steel for any number of potion effects
148+
// that apply whenever a player wakes up nearby.
149+
150+
mods.bewitchment.incense.removeByInput(item('bewitchment:essence_of_vitality'))
151+
mods.bewitchment.incense.removeByPotion(potion('minecraft:haste'))
152+
// mods.bewitchment.incense.removeAll()
153+
154+
mods.bewitchment.incense.recipeBuilder()
155+
.input(item('minecraft:clay'), item('minecraft:gold_ingot') * 5, item('minecraft:iron_ingot'))
156+
.potion(potion('minecraft:strength'), potion('minecraft:resistance'))
157+
.time(10000)
158+
.register()
159+
160+
161+
// Oven:
162+
// Converts an input itemstack into an output itemstack, with the ability to have a chance to produce an optional
163+
// itemstack, and if producing the optional itemstack will consume a `bewitchment:empty_jar`. Requires furnace fuel to run
164+
// and takes 10 seconds per recipe.
165+
166+
mods.bewitchment.oven.removeByInput(item('minecraft:sapling'))
167+
mods.bewitchment.oven.removeByOutput(item('bewitchment:tallow'))
168+
mods.bewitchment.oven.removeByOutput(item('bewitchment:garlic_grilled'))
169+
// mods.bewitchment.oven.removeAll()
170+
171+
mods.bewitchment.oven.recipeBuilder()
172+
.input(item('minecraft:clay'))
173+
.output(item('minecraft:diamond'))
174+
.requiresJar(false)
175+
.byproduct(item('minecraft:gold_nugget'))
176+
.byproductChance(0.2f)
177+
.register()
178+
179+
180+
// Pets:
181+
// Sets what animals are valid for summoning via the `FortuneMeetPet` effect.
182+
183+
mods.bewitchment.pet.remove(entity('minecraft:ocelot'))
184+
// mods.bewitchment.pet.removeAll()
185+
186+
mods.bewitchment.pet.add(entity('minecraft:cow'))
187+
188+
// Rituals:
189+
// Converts up to 10 input ingredients into a ritual. The ritual can output up to 5 items, can require specific small,
190+
// medium, and large circle sizes, can require a specific type for each circle, can require a specific entity nearby as a
191+
// sacrifice, can set the time the ritual takes, and can set the Magic Power consumed to start and run the ritual.
192+
193+
mods.bewitchment.ritual.removeByInput(item('minecraft:poisonous_potato'))
194+
mods.bewitchment.ritual.removeByOutput(item('bewitchment:purifying_earth'))
195+
// mods.bewitchment.ritual.removeAll()
196+
197+
198+
199+
// Sigils:
200+
// Converts up to 25 itemstacks into a single output itemstack.
201+
202+
mods.bewitchment.sigil.remove(resource('bewitchment:mending'))
203+
mods.bewitchment.sigil.removeByInput(item('bewitchment:bottle_of_blood'))
204+
mods.bewitchment.sigil.removeByOutput(item('bewitchment:sigil_disorientation'))
205+
// mods.bewitchment.sigil.removeAll()
206+
207+
208+
209+
// Spinning Wheel:
210+
// Converts up to 4 itemstacks into up to 2 output itemstacks in the Spinning Wheel at the cost of 1 Magic Power per tick.
211+
// Takes 10 seconds.
212+
213+
mods.bewitchment.spinning_wheel.remove(resource('bewitchment:cobweb'))
214+
mods.bewitchment.spinning_wheel.removeByInput(item('minecraft:string'))
215+
mods.bewitchment.spinning_wheel.removeByOutput(item('bewitchment:spirit_string'))
216+
// mods.bewitchment.spinning_wheel.removeAll()
217+
218+
mods.bewitchment.spinning_wheel.recipeBuilder()
219+
.input(item('minecraft:string'), item('minecraft:string'), item('minecraft:string'), item('minecraft:string'))
220+
.output(item('minecraft:gold_ingot') * 4, item('minecraft:web'))
221+
.register()
222+
223+

examples/postInit/botania.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Auto generated groovyscript example file
33
// MODS_LOADED: botania
44

5-
import net.minecraft.potion.PotionEffect
65
import net.minecraft.util.text.TextFormatting
76

87
log.info 'mod \'botania\' detected, running script'

examples/postInit/industrialforegoing.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Auto generated groovyscript example file
33
// MODS_LOADED: industrialforegoing
44

5-
import net.minecraft.potion.PotionEffect
6-
75
log.info 'mod \'industrialforegoing\' detected, running script'
86

97
// Bioreactor:

examples/postInit/rustic.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Auto generated groovyscript example file
33
// MODS_LOADED: rustic
44

5-
import net.minecraft.potion.PotionEffect
6-
75
log.info 'mod \'rustic\' detected, running script'
86

97
// Alchemy Condenser:

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ debug_better_with_addons = false
3939
debug_better_with_everything = false
4040
debug_better_with_mods = false
4141
debug_betweenlands = false
42+
debug_bewitchment = false
4243
debug_blood_arsenal = false
4344
debug_blood_magic = false
4445
debug_botania = false
@@ -278,6 +279,7 @@ curseForgeRelations = req:mixin-booter;\
278279
opt:atum;\
279280
opt:avaritia-1-10;\
280281
opt:better-with-addons;\
282+
opt:bewitchment;\
281283
opt:blood-arsenal;\
282284
opt:blood-magic;\
283285
opt:botania;\

src/main/java/com/cleanroommc/groovyscript/compat/mods/ModSupport.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.cleanroommc.groovyscript.compat.mods.betterwithaddons.BetterWithAddons;
2020
import com.cleanroommc.groovyscript.compat.mods.betterwithmods.BetterWithMods;
2121
import com.cleanroommc.groovyscript.compat.mods.betweenlands.Betweenlands;
22+
import com.cleanroommc.groovyscript.compat.mods.bewitchment.Bewitchment;
2223
import com.cleanroommc.groovyscript.compat.mods.bloodarsenal.BloodArsenal;
2324
import com.cleanroommc.groovyscript.compat.mods.bloodmagic.BloodMagic;
2425
import com.cleanroommc.groovyscript.compat.mods.botania.Botania;
@@ -110,6 +111,7 @@ public class ModSupport {
110111
public static final GroovyContainer<BetterWithAddons> BETTER_WITH_ADDONS = new InternalModContainer<>("betterwithaddons", "Better With Addons", BetterWithAddons::new);
111112
public static final GroovyContainer<BetterWithMods> BETTER_WITH_MODS = new InternalModContainer<>("betterwithmods", "Better With Mods", BetterWithMods::new);
112113
public static final GroovyContainer<Betweenlands> BETWEENLANDS = new InternalModContainer<>("thebetweenlands", "The Betweenlands", Betweenlands::new, "betweenlands");
114+
public static final GroovyContainer<Bewitchment> BEWITCHMENT = new InternalModContainer<>("bewitchment", "Bewitchment", Bewitchment::new);
113115
public static final GroovyContainer<BloodArsenal> BLOOD_ARSENAL = new InternalModContainer<>("bloodarsenal", "Blood Arsenal", BloodArsenal::new);
114116
public static final GroovyContainer<BloodMagic> BLOOD_MAGIC = new InternalModContainer<>("bloodmagic", "Blood Magic: Alchemical Wizardry", BloodMagic::new, "bm");
115117
public static final GroovyContainer<Botania> BOTANIA = new InternalModContainer<>("botania", "Botania", Botania::new);

src/main/java/com/cleanroommc/groovyscript/compat/mods/appliedenergistics2/Inscriber.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.cleanroommc.groovyscript.api.GroovyLog;
88
import com.cleanroommc.groovyscript.api.documentation.annotations.*;
99
import com.cleanroommc.groovyscript.compat.mods.ModSupport;
10+
import com.cleanroommc.groovyscript.helper.EnumHelper;
1011
import com.cleanroommc.groovyscript.helper.ingredient.IngredientHelper;
1112
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder;
1213
import com.cleanroommc.groovyscript.registry.VirtualizedRegistry;
@@ -82,7 +83,7 @@ public RecipeBuilder type(InscriberProcessType type) {
8283

8384
@RecipeBuilderMethodDescription
8485
public RecipeBuilder type(String type) {
85-
this.type = InscriberProcessType.valueOf(type.toUpperCase(Locale.ROOT));
86+
this.type = EnumHelper.valueOfNullable(InscriberProcessType.class, type, false);
8687
return this;
8788
}
8889

0 commit comments

Comments
 (0)