-
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.
Merge pull request #325 from Mixinors/development-1.16.3
1.11.2
- Loading branch information
Showing
152 changed files
with
4,061 additions
and
386 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...inmailstudios/astromine/datagen/generator/recipe/set/MultiBlastingSetRecipeGenerator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.github.chainmailstudios.astromine.datagen.generator.recipe.set; | ||
|
||
import net.minecraft.advancement.criterion.ImpossibleCriterion; | ||
import net.minecraft.data.server.recipe.CookingRecipeJsonFactory; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.recipe.Ingredient; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet; | ||
import me.shedaniel.cloth.api.datagen.v1.RecipeData; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
public class MultiBlastingSetRecipeGenerator extends MultiCookingSetRecipeGenerator { | ||
public MultiBlastingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, int time, float experience) { | ||
super(inputs, output, time, experience); | ||
} | ||
|
||
public MultiBlastingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, float experience) { | ||
this(inputs, output, 100, experience); | ||
} | ||
|
||
public MultiBlastingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output) { | ||
this(inputs, output, 100, 0.1f); | ||
} | ||
|
||
@Override | ||
public void generate(RecipeData recipes, MaterialSet set) { | ||
Collection<Item> items = getInputs(set); | ||
CookingRecipeJsonFactory | ||
.createBlasting( | ||
Ingredient.ofItems(items.toArray(new Item[0])), | ||
set.getItem(output), | ||
experience, | ||
time) | ||
.criterion("impossible", new ImpossibleCriterion.Conditions()) | ||
.offerTo(recipes, getRecipeId(set)); | ||
} | ||
|
||
@Override | ||
public String getRecipeName(MaterialSet set) { | ||
return set.getItemIdPath(output) + "_from_blasting"; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...ainmailstudios/astromine/datagen/generator/recipe/set/MultiCookingSetRecipeGenerator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.github.chainmailstudios.astromine.datagen.generator.recipe.set; | ||
|
||
import net.minecraft.item.Item; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.generator.recipe.set.base.CookingSetRecipeGenerator; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
public abstract class MultiCookingSetRecipeGenerator extends CookingSetRecipeGenerator { | ||
private final Collection<MaterialItemType> inputs; | ||
|
||
public MultiCookingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, int time, float experience) { | ||
super(inputs.stream().findFirst().get(), output, time, experience); | ||
this.inputs = inputs; | ||
} | ||
|
||
public Collection<MaterialItemType> getInputs() { | ||
return inputs; | ||
} | ||
|
||
public Collection<Item> getInputs(MaterialSet set) { | ||
ArrayList<Item> items = new ArrayList<>(); | ||
for(MaterialItemType type:getInputs()) { | ||
if(shouldGenerate(set, type)) items.add(set.getItem(type)); | ||
} | ||
return items; | ||
} | ||
|
||
@Override | ||
public boolean shouldGenerate(MaterialSet set) { | ||
boolean hasInput = false; | ||
for(MaterialItemType type:getInputs()) { | ||
if(set.hasType(type)) hasInput = true; | ||
} | ||
return hasInput && set.hasType(output); | ||
} | ||
|
||
public boolean shouldGenerate(MaterialSet set, MaterialItemType type) { | ||
return set.hasType(output) && set.hasType(type) && !(set.isFromVanilla(type) && set.isFromVanilla(output)); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...inmailstudios/astromine/datagen/generator/recipe/set/MultiSmeltingSetRecipeGenerator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.github.chainmailstudios.astromine.datagen.generator.recipe.set; | ||
|
||
import net.minecraft.advancement.criterion.ImpossibleCriterion; | ||
import net.minecraft.data.server.recipe.CookingRecipeJsonFactory; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.recipe.Ingredient; | ||
|
||
import com.github.chainmailstudios.astromine.datagen.material.MaterialItemType; | ||
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet; | ||
import me.shedaniel.cloth.api.datagen.v1.RecipeData; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
public class MultiSmeltingSetRecipeGenerator extends MultiCookingSetRecipeGenerator { | ||
|
||
public MultiSmeltingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, int time, float experience) { | ||
super(inputs, output, time, experience); | ||
} | ||
|
||
public MultiSmeltingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output, float experience) { | ||
this(inputs, output, 200, experience); | ||
} | ||
|
||
public MultiSmeltingSetRecipeGenerator(Collection<MaterialItemType> inputs, MaterialItemType output) { | ||
this(inputs, output, 200, 0.1f); | ||
} | ||
|
||
@Override | ||
public void generate(RecipeData recipes, MaterialSet set) { | ||
Collection<Item> items = getInputs(set); | ||
CookingRecipeJsonFactory | ||
.createSmelting( | ||
Ingredient.ofItems(items.toArray(new Item[0])), | ||
set.getItem(output), | ||
experience, | ||
time) | ||
.criterion("impossible", new ImpossibleCriterion.Conditions()) | ||
.offerTo(recipes, getRecipeId(set)); | ||
} | ||
|
||
@Override | ||
public String getRecipeName(MaterialSet set) { | ||
return set.getItemIdPath(output) + "_from_smelting"; | ||
} | ||
} |
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
49 changes: 0 additions & 49 deletions
49
...n/java/com/github/chainmailstudios/astromine/common/component/SidedComponentProvider.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.