Examples of DamagedItemDefinition


Examples of appeng.core.features.DamagedItemDefinition

        else
        {
          Field f = materialClass.getField( "material" + mat.name() );
          IStackSrc is = ((ItemMultiMaterial) materialItem.item()).createMaterial( mat );
          if ( is != null )
            f.set( materials, new DamagedItemDefinition( is ) );
          else
            f.set( materials, new NullItemDefinition() );
        }
      }
      catch (Throwable err)
      {
        AELog.severe( "Error creating material: " + mat.name() );
        throw new RuntimeException( err );
      }
    }

    AEItemDefinition partItem = addFeature( ItemMultiPart.class );

    Class partClass = parts.getClass();
    for (PartType type : PartType.values())
    {
      try
      {
        if ( type == PartType.InvalidType )
          ((ItemMultiPart) partItem.item()).createPart( type, null );
        else
        {
          Field f = partClass.getField( "part" + type.name() );
          Enum variants[] = type.getVariants();
          if ( variants == null )
          {
            ItemStackSrc is = ((ItemMultiPart) partItem.item()).createPart( type, null );
            if ( is != null )
              f.set( parts, new DamagedItemDefinition( is ) );
            else
              f.set( parts, new NullItemDefinition() );
          }
          else
          {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.