mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-10-25 20:32:19 +00:00
Add gregtech 6 support
This commit is contained in:
1 parent
23da96e1aa
commit
a66fed83ed
9 files changed
+99
-12
No files matched your search
@@ -22,7 +22,8 @@ This mod removes that functionality and allows the player to use NEI's transfer
|
||||
|
||||
- [ ] AppliedEnergistics2(Won't support it because AE2 doesn't register OverlayHandler)
|
||||
- [x] Vanilla
|
||||
- [x] GregTech
|
||||
- [x] GregTech5
|
||||
- [x] GregTech6
|
||||
- [x] IndustrialCraft2
|
||||
- [x] Avaritia
|
||||
- [x] EnderIO
|
||||
|
||||
+2
-1
@@ -16,7 +16,8 @@ NotEnoughEnergistics 是[Just Enough Energistics](https://www.curseforge.com/min
|
||||
|
||||
- [ ] AppliedEnergistics2(我们将不会支持AE2,因为AE2没有注册对应的OverlayHandler)
|
||||
- [x] Vanilla
|
||||
- [x] GregTech
|
||||
- [x] GregTech5
|
||||
- [x] GregTech6
|
||||
- [x] IndustrialCraft2
|
||||
- [x] Avaritia
|
||||
- [x] EnderIO
|
||||
|
||||
@@ -55,8 +55,6 @@ dependencies {
|
||||
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.138:dev"
|
||||
compile "codechicken:CodeChickenCore:1.7.10-1.0.7.+:dev"
|
||||
|
||||
runtime "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
|
||||
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ org.gradle.daemon=false
|
||||
mc_version=1.7.10
|
||||
nei_version=2.1.6-GTNH
|
||||
ae2_version=rv3-beta-52-GTNH
|
||||
mod_version=1.2.0
|
||||
mod_version=1.2.1
|
||||
forge_version=10.13.4.1614
|
||||
mod_group=com.github.vfyjxf.neenergistics
|
||||
mod_id=neenergistics
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -19,7 +19,7 @@ import java.util.Set;
|
||||
/**
|
||||
* @author vfyjxf
|
||||
*/
|
||||
public class GregTechRecipeProcessor implements IRecipeProcessor {
|
||||
public class GregTech5RecipeProcessor implements IRecipeProcessor {
|
||||
|
||||
private static final Class<?> gtDefaultClz, gtAssLineClz;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.github.vfyjxf.nee.processor;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import gregapi.NEI_RecipeMap;
|
||||
import gregapi.NEI_RecipeMap.FixedPositionedStack;
|
||||
import gregapi.data.FL;
|
||||
import gregapi.recipes.Recipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author vfyjxf
|
||||
*/
|
||||
public class GregTech6RecipeProcessor implements IRecipeProcessor {
|
||||
@Override
|
||||
public Set<String> getAllOverlayIdentifier() {
|
||||
Set<String> identifiers = new HashSet<>();
|
||||
for (Recipe.RecipeMap tMap : Recipe.RecipeMap.RECIPE_MAPS.values()) {
|
||||
if (tMap.mNEIAllowed) {
|
||||
identifiers.add(tMap.mNameNEI);
|
||||
}
|
||||
}
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeProcessorId() {
|
||||
return "GregTech6";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
|
||||
for (String ident : getAllOverlayIdentifier()) {
|
||||
if (ident.equals(identifier)) {
|
||||
List<PositionedStack> recipeInputs = new ArrayList<>(recipe.getIngredientStacks(recipeIndex));
|
||||
//remove fluid
|
||||
recipeInputs.removeIf(positionedStack -> FL.getFluid(positionedStack.item, true) != null || positionedStack.item.stackSize == 0);
|
||||
//try to remove machine
|
||||
if (recipe instanceof NEI_RecipeMap) {
|
||||
Field mRecipeMapField = ReflectionHelper.findField(NEI_RecipeMap.class, "mRecipeMap");
|
||||
Recipe.RecipeMap mRecipeMap = null;
|
||||
try {
|
||||
mRecipeMap = (Recipe.RecipeMap) mRecipeMapField.get(recipe);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (mRecipeMap != null) {
|
||||
ItemStack lastItem = (recipeInputs.get(recipeInputs.size() - 1)).items[0];
|
||||
for (ItemStack stack : mRecipeMap.mRecipeMachineList) {
|
||||
if (ItemStack.areItemStackTagsEqual(lastItem, stack)) {
|
||||
recipeInputs.remove(recipeInputs.size() - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return recipeInputs;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
|
||||
for (String ident : getAllOverlayIdentifier()) {
|
||||
if (ident.equals(identifier)) {
|
||||
List<PositionedStack> recipeOutput = new ArrayList<>(recipe.getOtherStacks(recipeIndex));
|
||||
recipeOutput.removeIf(positionedStack -> FL.getFluid(positionedStack.item, true) != null || positionedStack.item.stackSize == 0);
|
||||
//try to remove item output if it's chance != 100%
|
||||
recipeOutput.removeIf(positionedStack -> positionedStack instanceof FixedPositionedStack && ((FixedPositionedStack) positionedStack).mChance > 0 && ((FixedPositionedStack) positionedStack).mChance != ((FixedPositionedStack) positionedStack).mMaxChance);
|
||||
return recipeOutput;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,13 @@ public class RecipeProcessor {
|
||||
NotEnoughEnergistics.logger.info("Install Vanilla Support");
|
||||
recipeProcessors.add(new VanillaRecipeProcessor());
|
||||
|
||||
if (Loader.isModLoaded("gregtech")) {
|
||||
NotEnoughEnergistics.logger.info("Found GregTech,install GregTech support");
|
||||
recipeProcessors.add(new GregTechRecipeProcessor());
|
||||
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi")) {
|
||||
NotEnoughEnergistics.logger.info("Found GregTech5,install GregTech5 support");
|
||||
recipeProcessors.add(new GregTech5RecipeProcessor());
|
||||
}
|
||||
if (Loader.isModLoaded("gregapi") && Loader.isModLoaded("gregapi_post")) {
|
||||
NotEnoughEnergistics.logger.info("Found GregTech6,install GregTech6 support");
|
||||
recipeProcessors.add(new GregTech6RecipeProcessor());
|
||||
}
|
||||
if (Loader.isModLoaded("IC2")) {
|
||||
NotEnoughEnergistics.logger.info("Found IC2,install IC2 Support");
|
||||
@@ -26,15 +30,15 @@ public class RecipeProcessor {
|
||||
NotEnoughEnergistics.logger.info("Found Avaritia, install Avaritia support");
|
||||
recipeProcessors.add(new AvaritiaRecipeProcessor());
|
||||
}
|
||||
if(Loader.isModLoaded("EnderIO")){
|
||||
if (Loader.isModLoaded("EnderIO")) {
|
||||
NotEnoughEnergistics.logger.info("Found EnderIO, install EnderIO support");
|
||||
recipeProcessors.add(new EnderIORecipeProcessor());
|
||||
}
|
||||
if(Loader.isModLoaded("Forestry")){
|
||||
if (Loader.isModLoaded("Forestry")) {
|
||||
NotEnoughEnergistics.logger.info("Found Forestry, install Forestry support");
|
||||
recipeProcessors.add(new ForestryRecipeProcessor());
|
||||
}
|
||||
if(Loader.isModLoaded("thaumcraftneiplugin")){
|
||||
if (Loader.isModLoaded("thaumcraftneiplugin")) {
|
||||
NotEnoughEnergistics.logger.info("Found TCNEIPlugin, install TCNEIPlugin support");
|
||||
recipeProcessors.add(new TCNEIPluginRecipeProcessor());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user