Rework custom recipe system (#3232)

This commit is contained in:
fscan
2018-06-24 17:20:29 +02:00
committed by GitHub
parent e72b5b369c
commit 841bc6e356
165 changed files with 680 additions and 6300 deletions
@@ -33,6 +33,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -43,6 +44,7 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.implementations.items.IItemGroup;
@@ -376,4 +378,20 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
}
}
public void registerOreDicts()
{
for( final PartTypeWithVariant mt : ImmutableSet.copyOf( this.registered.values() ) )
{
if( mt.part.getOreName() != null )
{
final String[] names = mt.part.getOreName().split( "," );
for( final String name : names )
{
OreDictionary.registerOre( name, new ItemStack( this, 1, mt.part.getBaseDamage() + mt.variant ) );
}
}
}
}
}