Merge branch 'master' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
Conflicts: core/localization/GuiText.java core/sync/AppEngPacketHandlerBase.java
This commit is contained in:
@@ -41,8 +41,8 @@ public enum AEFeature
|
||||
|
||||
DenseEnergyCells("HigherCapacity"), DenseCables("HigherCapacity"),
|
||||
|
||||
P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ("P2PTunnels"), P2PTunnelLiquids(
|
||||
"P2PTunnels"),
|
||||
P2PTunnelRF("P2PTunnels"), P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ(
|
||||
"P2PTunnels"), P2PTunnelLiquids("P2PTunnels"),
|
||||
|
||||
MassCannonBlockDamage("BlockFeatures"), TinyTNTBlockDamage("BlockFeatures"), Facades("Facades"),
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.features.IGrinderEntry;
|
||||
import appeng.api.features.IGrinderRegistry;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.features.registries.entries.AppEngGrinderRecipe;
|
||||
import appeng.recipes.ores.IOreListener;
|
||||
import appeng.recipes.ores.OreDictionaryHandler;
|
||||
@@ -60,6 +60,15 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
return RecipeList;
|
||||
}
|
||||
|
||||
private void injectRecipe(AppEngGrinderRecipe appEngGrinderRecipe)
|
||||
{
|
||||
for (IGrinderEntry gr : RecipeList)
|
||||
if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
return;
|
||||
|
||||
RecipeList.add( appEngGrinderRecipe );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(ItemStack in, ItemStack out, int cost)
|
||||
{
|
||||
@@ -70,7 +79,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
}
|
||||
|
||||
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost );
|
||||
RecipeList.add( new AppEngGrinderRecipe( copy( in ), copy( out ), cost ) );
|
||||
injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), cost ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,7 +93,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
|
||||
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
|
||||
+ Platform.getItemDisplayName( optional ) + " for " + cost );
|
||||
RecipeList.add( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) );
|
||||
injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.api.definitions.Parts;
|
||||
@@ -70,7 +71,7 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
@Override
|
||||
public void addNewAttunement(ItemStack trigger, TunnelType type)
|
||||
{
|
||||
if ( type == null )
|
||||
if ( type == null || trigger == null )
|
||||
return;
|
||||
|
||||
Tunnels.put( trigger, type );
|
||||
@@ -79,13 +80,19 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
@Override
|
||||
public TunnelType getTunnelTypeByItem(ItemStack trigger)
|
||||
{
|
||||
if ( FluidContainerRegistry.isContainer( trigger ) )
|
||||
return TunnelType.FLUID;
|
||||
|
||||
for (ItemStack is : Tunnels.keySet())
|
||||
if ( trigger != null )
|
||||
{
|
||||
if ( Platform.isSameItem( is, trigger ) )
|
||||
return Tunnels.get( is );
|
||||
if ( FluidContainerRegistry.isContainer( trigger ) )
|
||||
return TunnelType.FLUID;
|
||||
|
||||
for (ItemStack is : Tunnels.keySet())
|
||||
{
|
||||
if ( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE )
|
||||
return Tunnels.get( is );
|
||||
|
||||
if ( Platform.isSameItem( is, trigger ) )
|
||||
return Tunnels.get( is );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user