-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Demo DME Sim Chamber Recipes (In Groovy), Cap Counts to Max Int V…
…alue
- Loading branch information
1 parent
bc138df
commit 47c24ed
Showing
5 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import com.nomiceu.nomilabs.LabsValues | ||
import mustapelto.deepmoblearning.common.metadata.MetadataDataModel | ||
import mustapelto.deepmoblearning.common.metadata.MetadataManager | ||
import net.minecraftforge.fml.common.Loader | ||
|
||
// Demonstration of Dynamically Generated DME Sim Chamber Recipes. (Goes in Post Init) | ||
// DOES NOT WORK IF DME IS NOT INCLUDED IN LOAD! | ||
|
||
def models = MetadataManager.dataModelMetadataList | ||
for (var model : models) { | ||
if (!Loader.isModLoaded(model.modID)) continue | ||
|
||
int tier = MetadataManager.minDataModelTier | ||
while (!MetadataManager.isMaxDataModelTier(tier)){ | ||
addDMERecipe(model, tier) | ||
tier = MetadataManager.getNextDataModelTier(tier) | ||
} | ||
// Since this does not include maximum tier... | ||
addDMERecipe(model, MetadataManager.getNextDataModelTier(tier)) | ||
} | ||
|
||
void addDMERecipe(MetadataDataModel model, int tier) { | ||
def tierData = MetadataManager.getDataModelTierData(tier) | ||
if (!tierData.present || !tierData.get().canSimulate) return | ||
|
||
def modelPath = model.dataModelRegistryID | ||
def living = model.livingMatter | ||
def pristine = model.pristineMatter | ||
def eut = model.simulationRFCost / 4 | ||
|
||
int chance = tierData.get().pristineChance | ||
|
||
mods.gregtech.dme_sim_chamber.recipeBuilder() | ||
.dataItem(item("${LabsValues.DME_MODID}:${modelPath}"), tier) | ||
.input(item('deepmoblearning:polymer_clay').item) | ||
.output(living.item) | ||
.chancedOutput(pristine, chance * 100, 0) // Chanced Outputs are In Per 100 (100 = 1%) | ||
.EUt(eut as int) | ||
.duration(300) | ||
.buildAndRegister() | ||
} |
3 changes: 2 additions & 1 deletion
3
...main/java/com/nomiceu/nomilabs/gregtech/metatileentity/registry/LabsMetaTileEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters