public boolean mayICraft(final Item I) {
   if (I == null) return false;
   if (!super.mayBeCrafted(I)) return false;
   if ((I.material() & RawMaterial.MATERIAL_MASK) != RawMaterial.MATERIAL_LEATHER) return false;
   if (CMLib.flags().isDeadlyOrMaliciousEffect(I)) return false;
   if (I.basePhyStats().level() < 31) return (isANativeItem(I.Name()));
   if (I instanceof Armor) {
     final long noWearLocations =
         Wearable.WORN_LEFT_FINGER | Wearable.WORN_RIGHT_FINGER | Wearable.WORN_EARS;
     if ((I.rawProperLocationBitmap() & noWearLocations) > 0) return (isANativeItem(I.Name()));
     return true;
   }
   if (I instanceof Rideable) {
     Rideable R = (Rideable) I;
     int rideType = R.rideBasis();
     switch (rideType) {
       case Rideable.RIDEABLE_SLEEP:
       case Rideable.RIDEABLE_SIT:
       case Rideable.RIDEABLE_TABLE:
         return true;
       default:
         return false;
     }
   }
   if (I instanceof Shield) return true;
   if (I instanceof Weapon) {
     Weapon W = (Weapon) I;
     if ((W.requiresAmmunition()) || (W.weaponClassification() == Weapon.CLASS_FLAILED))
       return true;
     return (isANativeItem(I.Name()));
   }
   if (I instanceof Container) return true;
   if ((I instanceof Drink) && (!(I instanceof Potion))) return true;
   if (I instanceof FalseLimb) return true;
   if (I.rawProperLocationBitmap() == Wearable.WORN_HELD) return true;
   return (isANativeItem(I.Name()));
 }
Example #2
0
 public boolean mayICraft(final Item I) {
   if (I == null) return false;
   if (!super.mayBeCrafted(I)) return false;
   if (I.material() == RawMaterial.RESOURCE_PAPER) return false;
   if ((I.material() != RawMaterial.RESOURCE_COTTON)
       && (I.material() != RawMaterial.RESOURCE_SILK)
       && (I.material() != RawMaterial.RESOURCE_HEMP)
       && (I.material() != RawMaterial.RESOURCE_VINE)
       && (I.material() != RawMaterial.RESOURCE_WHEAT)
       && (I.material() != RawMaterial.RESOURCE_SEAWEED)
       && (((I.material() & RawMaterial.MATERIAL_MASK) != RawMaterial.MATERIAL_VEGETATION)))
     return false;
   if (CMLib.flags().isDeadlyOrMaliciousEffect(I)) return false;
   if (I instanceof Rideable) {
     Rideable R = (Rideable) I;
     int rideType = R.rideBasis();
     switch (rideType) {
       case Rideable.RIDEABLE_LADDER:
       case Rideable.RIDEABLE_SLEEP:
       case Rideable.RIDEABLE_SIT:
       case Rideable.RIDEABLE_TABLE:
         return true;
       default:
         return false;
     }
   }
   if (I instanceof Shield) return true;
   if (I instanceof Weapon) return true;
   if (I instanceof Light) return true;
   if (I instanceof Armor) return (isANativeItem(I.Name()));
   if (I instanceof Container) return true;
   if ((I instanceof Drink) && (!(I instanceof Potion))) return true;
   if (I instanceof FalseLimb) return true;
   if (I instanceof Wand) return true;
   if (I.rawProperLocationBitmap() == Wearable.WORN_HELD) return true;
   return (isANativeItem(I.Name()));
 }