Consistent Seeds.
This commit is contained in:
parent
4078000005
commit
5db06128f8
3 changed files with 29 additions and 10 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.util.IIcon;
|
|||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IGrowableCrystal;
|
||||
import appeng.api.recipes.ResolverResult;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.entity.EntityGrowingCrystal;
|
||||
|
@ -238,10 +239,18 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
|||
l.add( newStyle( new ItemStack( this, 1, LEVEL_OFFSET * 2 + Fluix ) ) );
|
||||
}
|
||||
|
||||
private ItemStack newStyle(ItemStack itemStack)
|
||||
private static ItemStack newStyle(ItemStack itemStack)
|
||||
{
|
||||
getProgress( itemStack );
|
||||
((ItemCrystalSeed) itemStack.getItem()).getProgress( itemStack );
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public static ResolverResult getResolver(int certus2)
|
||||
{
|
||||
ItemStack is = AEApi.instance().items().itemCrystalSeed.stack( 1 );
|
||||
is.setItemDamage( certus2 );
|
||||
is = newStyle( is );
|
||||
return new ResolverResult( "ItemCrystalSeed", is.getItemDamage(), is.getTagCompound() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,12 +24,12 @@ public class AEItemResolver implements ISubItemResolver
|
|||
{
|
||||
if ( itemName.startsWith( "PaintBall." ) )
|
||||
{
|
||||
return paintBall(AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ),false );
|
||||
return paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), false );
|
||||
}
|
||||
|
||||
if ( itemName.startsWith( "LumenPaintBall." ) )
|
||||
{
|
||||
return paintBall(AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true );
|
||||
return paintBall( AEApi.instance().items().itemPaintBall, itemName.substring( itemName.indexOf( "." ) + 1 ), true );
|
||||
}
|
||||
|
||||
if ( itemName.equals( "CableGlass" ) )
|
||||
|
@ -75,7 +75,7 @@ public class AEItemResolver implements ISubItemResolver
|
|||
if ( itemName.startsWith( "ItemCrystalSeed." ) )
|
||||
{
|
||||
if ( itemName.equalsIgnoreCase( "ItemCrystalSeed.Certus" ) )
|
||||
return new ResolverResult( "ItemCrystalSeed", ItemCrystalSeed.Certus );
|
||||
return ItemCrystalSeed.getResolver( ItemCrystalSeed.Certus );
|
||||
if ( itemName.equalsIgnoreCase( "ItemCrystalSeed.Nether" ) )
|
||||
return new ResolverResult( "ItemCrystalSeed", ItemCrystalSeed.Nether );
|
||||
if ( itemName.equalsIgnoreCase( "ItemCrystalSeed.Fluix" ) )
|
||||
|
@ -122,11 +122,11 @@ public class AEItemResolver implements ISubItemResolver
|
|||
|
||||
if ( col == AEColor.Transparent )
|
||||
return null;
|
||||
|
||||
|
||||
ItemStack is = partType.stack( col, 1 );
|
||||
return new ResolverResult( "ItemPaintBall", (lumen?20:0)+is.getItemDamage() );
|
||||
return new ResolverResult( "ItemPaintBall", (lumen ? 20 : 0) + is.getItemDamage() );
|
||||
}
|
||||
|
||||
|
||||
private Object cableItem(AEColoredItemDefinition partType, String substring)
|
||||
{
|
||||
AEColor col = AEColor.Transparent;
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingIngredientError;
|
||||
|
@ -23,6 +24,7 @@ public class Ingredient implements IIngredient
|
|||
final public String nameSpace;
|
||||
final public String itemName;
|
||||
final public int meta;
|
||||
NBTTagCompound nbt = null;
|
||||
|
||||
final public int qty;
|
||||
|
||||
|
@ -69,6 +71,7 @@ public class Ingredient implements IIngredient
|
|||
ResolverResult rr = (ResolverResult) ro;
|
||||
tmpName = rr.itemName;
|
||||
sel = rr.damageValue;
|
||||
nbt = rr.compound;
|
||||
}
|
||||
else if ( ro instanceof ResolverResultSet )
|
||||
{
|
||||
|
@ -126,7 +129,7 @@ public class Ingredient implements IIngredient
|
|||
{
|
||||
Item it = Item.getItemFromBlock( blk );
|
||||
if ( it != null )
|
||||
return new ItemStack( it, qty, meta );
|
||||
return MakeItemStack( it, qty, meta, nbt );
|
||||
}
|
||||
|
||||
Item it = GameRegistry.findItem( nameSpace, itemName );
|
||||
|
@ -134,7 +137,7 @@ public class Ingredient implements IIngredient
|
|||
it = GameRegistry.findItem( nameSpace, "item." + itemName );
|
||||
|
||||
if ( it != null )
|
||||
return new ItemStack( it, qty, meta );
|
||||
return MakeItemStack( it, qty, meta, nbt );
|
||||
|
||||
/*
|
||||
* Object o = Item.itemRegistry.getObject( nameSpace + ":" + itemName ); if ( o instanceof Item ) return new
|
||||
|
@ -152,6 +155,13 @@ public class Ingredient implements IIngredient
|
|||
throw new MissingIngredientError( "Unable to find item: " + toString() );
|
||||
}
|
||||
|
||||
private ItemStack MakeItemStack(Item it, int quantity, int damageValue, NBTTagCompound compound)
|
||||
{
|
||||
ItemStack is = new ItemStack( it, quantity, damageValue );
|
||||
is.setTagCompound( compound );
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue