Added Railcraft Integration.
This commit is contained in:
@@ -129,6 +129,7 @@ import appeng.recipes.RecipeHandler;
|
||||
import appeng.recipes.game.FacadeRecipe;
|
||||
import appeng.recipes.game.ShapedRecipe;
|
||||
import appeng.recipes.game.ShapelessRecipe;
|
||||
import appeng.recipes.handlers.Crusher;
|
||||
import appeng.recipes.handlers.Grind;
|
||||
import appeng.recipes.handlers.GrindFZ;
|
||||
import appeng.recipes.handlers.Inscribe;
|
||||
@@ -178,6 +179,7 @@ public class Registration
|
||||
recipeRegistery.addNewSubItemResolver( new AEItemResolver() );
|
||||
|
||||
recipeRegistery.addNewCraftHandler( "grind", Grind.class );
|
||||
recipeRegistery.addNewCraftHandler( "crusher", Crusher.class );
|
||||
recipeRegistery.addNewCraftHandler( "grindfz", GrindFZ.class );
|
||||
recipeRegistery.addNewCraftHandler( "pulverizer", Pulverizer.class );
|
||||
recipeRegistery.addNewCraftHandler( "macerator", Macerator.class );
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IRC
|
||||
{
|
||||
|
||||
void rockCrusher(ItemStack input, ItemStack output);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
import mods.railcraft.api.crafting.IRockCrusherRecipe;
|
||||
import mods.railcraft.api.crafting.RailcraftCraftingManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.integration.BaseModule;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IRC;
|
||||
|
||||
public class RC extends BaseModule implements IIntegrationModule, IRC
|
||||
{
|
||||
|
||||
public static RC instance;
|
||||
|
||||
@Override
|
||||
public void rockCrusher(ItemStack input, ItemStack output)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
}
|
||||
|
||||
public RC() {
|
||||
TestClass( RailcraftCraftingManager.class );
|
||||
TestClass( IRockCrusherRecipe.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package appeng.integration.modules.dead;
|
||||
|
||||
import mods.railcraft.api.crafting.IRockCrusherRecipe;
|
||||
import mods.railcraft.api.crafting.RailcraftCraftingManager;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public class RC implements IIntegrationModule
|
||||
{
|
||||
|
||||
public static RC instance;
|
||||
|
||||
public void rockCrusher(ItemStack input, ItemStack output)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
}
|
||||
|
||||
public void rockCrusher(ItemStack input, ItemStack output, ItemStack secondary, float chance)
|
||||
{
|
||||
IRockCrusherRecipe re = RailcraftCraftingManager.rockCrusher.createNewRecipe( input, true, true );
|
||||
re.addOutput( output, 1.0f );
|
||||
if ( secondary != null ) re.addOutput( secondary, chance );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Init()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void PostInit()
|
||||
{
|
||||
// certus quartz
|
||||
rockCrusher( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
rockCrusher( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
|
||||
AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
|
||||
|
||||
// fluix
|
||||
rockCrusher( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
|
||||
|
||||
// nether quartz
|
||||
rockCrusher( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler
|
||||
{
|
||||
if ( this.outputs.size() > recipe )
|
||||
{
|
||||
PositionedStack cr = this.outputs.get( recipe );
|
||||
// PositionedStack cr = this.outputs.get( recipe );
|
||||
String details = this.details.get( this.offsets.get( recipe ) );
|
||||
|
||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package appeng.recipes.handlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
import appeng.api.exceptions.RecipeError;
|
||||
import appeng.api.exceptions.RegistrationError;
|
||||
import appeng.api.recipes.ICraftHandler;
|
||||
import appeng.api.recipes.IIngredient;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.integration.abstraction.IRC;
|
||||
import appeng.recipes.RecipeHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class Crusher implements ICraftHandler, IWebsiteSeralizer
|
||||
{
|
||||
|
||||
IIngredient pro_input;
|
||||
IIngredient pro_output[];
|
||||
|
||||
@Override
|
||||
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
|
||||
{
|
||||
if ( input.size() == 1 && output.size() == 1 )
|
||||
{
|
||||
int outs = output.get( 0 ).size();
|
||||
if ( input.get( 0 ).size() == 1 && outs == 1 )
|
||||
{
|
||||
pro_input = input.get( 0 ).get( 0 );
|
||||
pro_output = output.get( 0 ).toArray( new IIngredient[outs] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
new RecipeError( "Crusher must have a single input, and single output." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register() throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
if ( AppEng.instance.isIntegrationEnabled( "RC" ) )
|
||||
{
|
||||
IRC rc = (IRC) AppEng.instance.getIntegration( "RC" );
|
||||
for (ItemStack is : pro_input.getItemStackSet())
|
||||
{
|
||||
try
|
||||
{
|
||||
rc.rockCrusher( is, pro_output[0].getItemStack() );
|
||||
}
|
||||
catch (java.lang.RuntimeException err)
|
||||
{
|
||||
AELog.info( "RC not happy - " + err.getMessage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(ItemStack output) throws RegistrationError, MissingIngredientError
|
||||
{
|
||||
return Platform.isSameItemPrecise( pro_output[0].getItemStack(), output );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern(RecipeHandler h)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class ASMIntegration implements IClassTransformer
|
||||
|
||||
integrationModules.add( IntegrationSide.BOTH, "Rotary Craft", "RotaryCraft", "RotaryCraft" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "Industrial Craft 2", "IC2", "IC2" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Railcraft", "Railcraft", "RC" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "Railcraft", "Railcraft", "RC" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Thermal Expansion", "ThermalExpansion", "TE" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Mystcraft", "Mystcraft", "Mystcraft" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "BuildCraft", "BuildCraft|Silicon", "BC" );
|
||||
@@ -40,7 +40,7 @@ public class ASMIntegration implements IClassTransformer
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Greg Tech", "gregtech_addon", "GT" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Universal Electricity", null, "UE" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Logistics Pipes", "LogisticsPipes|Main", "LP" );
|
||||
// integrationModules.add( IntegrationSide.CLIENT, "Inventory Tweaks", "", "InvTweaks" );
|
||||
integrationModules.add( IntegrationSide.CLIENT, "Inventory Tweaks", "", "InvTweaks" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "Mine Factory Reloaded", "MineFactoryReloaded", "MFR" );
|
||||
integrationModules.add( IntegrationSide.BOTH, "Deep Storage Unit", null, "DSU" );
|
||||
// integrationModules.add( IntegrationSide.BOTH, "Better Storage", "betterstorage" );
|
||||
|
||||
Reference in New Issue
Block a user